Skip to content

Commit

Permalink
2014-04-30 : fix filename as bookname's first choice, Fix some link
Browse files Browse the repository at this point in the history
  • Loading branch information
linpinger committed Apr 30, 2014
1 parent 92d56b4 commit e96fe07
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Txt2eBook(文本转电子书:mobi,epub,pdf,umd)

**邮箱:** [linpinger@gmail.com](mailto:linpinger@gmail.com)

**主页:** <http://www.autohotkey.net/~linpinger/index.html?s=Atc_Txt2eBook>
**主页:** <http://linpinger.github.io?s=Atc_Txt2eBook>

**缘起:** 基于txt2mobi程序,添加其他格式支持,扩大使用范围

**原理:** TXT -\> UTF-8 HTML/NCX/OPF -\>(kindlegen/mobigen) Mobi / Epub

**下载:**
- 程序(单独处理txt, 生成目录): [Txt2eBook.exe](Txt2eBook.exe)
- 程序(单独处理txt, 生成目录): [Txt2eBook.exe](../../releases/download/Txt2eBook/Txt2eBook.exe)
- 源代码(单独处理txt, 生成目录): [Txt2eBook.ahkL](Txt2eBook.ahkL)

本程序从[AnsiTxt2Mobi](../mobi/AnsiTxt2Mobi.html)升级而来
Expand All @@ -40,6 +40,7 @@ Txt2eBook(文本转电子书:mobi,epub,pdf,umd)

**更新日志:**

- 2014-04-30: 修正: 默认优先以文件名做书名,如果为数字,选一行为书名,若为空,为FoxBook
- 2013-03-09: 添加: 选择文件按钮,便于在无法拖动的场合选择文件,多谢atuo
- 2013-02-27: 修正: 提示行修正,多谢Andy Wu
- 2013-02-18: 修正: Mac下解析br标签错误,替换为br闭合标签,多谢Shawn Wu
Expand Down
25 changes: 15 additions & 10 deletions Txt2eBook.ahkL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#NoENV
; 预计功能: 根据正则分析标题,生成包含目录的ebook文件
VerDate := "2014-03-09"
VerDate := "2014-04-30"
; 2013-5-7: mobigen生成的mobi格式在Kindle PaperWhite上,跳转目录显示为乱码,需使用kindlegen
If A_IsCompiled
{
Expand Down Expand Up @@ -198,9 +198,9 @@ FoxMenuAct:
If ( A_thismenuitem = "www.olsoul.com(&W)" )
OpenURL("http://www.olsoul.com")
If ( A_thismenuitem = "关于作者(&A)" )
TrayTip, 爱尔兰之狐:, QQ: 308639546`nhttp://www.autohotkey.net/~linpinger/index.html
TrayTip, 爱尔兰之狐:, QQ: 308639546`nhttp://linpinger.github.io
If ( A_thismenuitem = "作者作品页(&L)" )
OpenURL("http://www.autohotkey.net/~linpinger/index.html?s=ExeTxt2eBook")
OpenURL("http://linpinger.github.io?s=ExeTxt2eBook")

return

Expand Down Expand Up @@ -255,14 +255,19 @@ ReDragFile: ;
SB_SetText("稍候,正则处理文件中...")
sTime := A_TickCount

FileReadLine, BookName, %SrcFilePath%, 1
If ( BookName != "" )
LV_Add("", BookName, "★书名行,按F2修改,勿删本行★")
else {
SplitPath, SrcFilePath, , , , OutNameNoExt
; 以文件名当作书名
SplitPath, SrcFilePath, , , , OutNameNoExt
if OutNameNoExt is integer
{ ; 当文件名是数字时取第一行做书名
FileReadLine, BookName, %SrcFilePath%, 1
If ( BookName != "" )
LV_Add("", BookName, "★书名行,按F2修改,勿删本行★")
else
LV_Add("", "FoxBook", "★书名行,按F2修改,勿删本行★")
} else {
LV_Add("", OutNameNoExt, "★书名行,按F2修改,勿删本行★")
Traytip, 未检测到书名:, 以文件名替代书名,如有错误:`n请选中列表第一行并按F2修改
}

LV_Add("", "爱尔兰之狐", "★作者行,按F2修改,勿删本行★")
loop, parse, NR, `n, `r
{
Expand Down Expand Up @@ -496,7 +501,7 @@ LV_MoveRow(moveup = true) { ;
}
}

OpenURL(URL="http://www.autohotkey.net/~linpinger/index.html?s=ExeTxt2eBook")
OpenURL(URL="http://linpinger.github.io?s=ExeTxt2eBook")
{
IfExist, %A_ProgramFiles%\Internet Explorer\IEXPLORE.EXE
run, %A_ProgramFiles%\Internet Explorer\IEXPLORE.EXE -new %URL%
Expand Down
Binary file modified Txt2eBook.exe
Binary file not shown.
5 changes: 3 additions & 2 deletions Txt2eBook.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ <h2>Txt2eBook(文本转电子书:mobi,epub,pdf,umd)</h2>
<b>功能:</b> 将文本文件转换为各种格式的电子书:mobi(Kindel电子书),Epub(不包含字体),pdf(6寸),umd(手机电子书)<br>
<b>作者:</b> 爱尔兰之狐(linpinger)<br>
<b>邮箱:</b> <a href="mailto:linpinger@gmail.com">linpinger@gmail.com</a><br>
<b>主页:</b> <a href="http://www.autohotkey.net/~linpinger/index.html?s=Atc_Txt2eBook">http://www.autohotkey.net/~linpinger/index.html?s=Atc_Txt2eBook</a><br>
<b>主页:</b> <a href="http://linpinger.github.io?s=Atc_Txt2eBook">http://linpinger.github.io?s=Atc_Txt2eBook</a><br>
<br>
<b>缘起:</b> 基于txt2mobi程序,添加其他格式支持,扩大使用范围<br>
<b>原理:</b> TXT -&gt; UTF-8 HTML/NCX/OPF -&gt;(kindlegen/mobigen) Mobi / Epub<br>
<br>
<b>下载:</b><br>
<ul>
<li>程序(单独处理txt, 生成目录):</b> <a href="Txt2eBook.exe">Txt2eBook.exe</a></li>
<li>程序(单独处理txt, 生成目录):</b> <a href="../../releases/download/Txt2eBook/Txt2eBook.exe">Txt2eBook.exe</a></li>
<hr>
<li>源代码(单独处理txt, 生成目录):</b> <a href="Txt2eBook.ahkL">Txt2eBook.ahkL</a></li>
</ul>
Expand All @@ -53,6 +53,7 @@ <h2>Txt2eBook(文本转电子书:mobi,epub,pdf,umd)</h2>

<b>更新日志:</b><br>
<ul>
<li>2014-04-30: 修正: 默认优先以文件名做书名,如果为数字,选一行为书名,若为空,为FoxBook</li>
<li>2013-03-09: 添加: 选择文件按钮,便于在无法拖动的场合选择文件,多谢atuo</li>
<li>2013-02-27: 修正: 提示行修正,多谢Andy Wu</li>
<li>2013-02-18: 修正: Mac下解析br标签错误,替换为br闭合标签,多谢Shawn Wu</li>
Expand Down

0 comments on commit e96fe07

Please sign in to comment.