我希望把多个 txt 转成一个 epub,并生成以文件为单位的目录结构:
目录
1.txt
2.txt
...
n.txt
我用的是 pandoc,其 --toc
参数好像对 txt 文件无效,是还需要其他参数配合吗?
或者有没有其他的工具可以实现?
我希望把多个 txt 转成一个 epub,并生成以文件为单位的目录结构:
目录
1.txt
2.txt
...
n.txt
我用的是 pandoc,其 --toc
参数好像对 txt 文件无效,是还需要其他参数配合吗?
或者有没有其他的工具可以实现?
python有一个工具可以做,忘了叫啥名了,挺早了。
calibre 我也试过的,似乎不支持 txt -> epub:
$ ebook-convert epub/*.txt epub/output.epub --formatting-type plain
Extra arguments not understood: epub/2.txt, epub/3.txt, epub/4.txt, epub/5.txt, epub/6.txt, epub/7.txt, epub/8.txt, epub/9.txt, epub/output.epub --formatting-type, plain
看了眼,貌似不支持多个文件,要先合成一个,另外 ebook-convert 生成 toc 是通过 xpath 的https://manual.calibre-ebook.com/generated/en/ebook-convert.html#cmdoption-ebook-convert-chapter,不知道纯文本是否支持。