All Projects → ystyle → kaf-cli

ystyle / kaf-cli

Licence: other
把txt文本转成epub和mobi电子书的命令行工具(原TmdTextEpub)

Programming Languages

go
31211 projects - #10 most used programming language
powershell
5483 projects
shell
77523 projects

Projects that are alternatives of or similar to kaf-cli

Kotlin Reference Chinese
Kotlin 官方文档(参考部分)中文版
Stars: ✭ 85 (-36.09%)
Mutual labels:  mobi, epub
scopy
Python script for searching through your digital books and cataloguing them in an easy-to-share list of files.
Stars: ✭ 28 (-78.95%)
Mutual labels:  mobi, epub
Fb2mobi
[DEPRECATED] fb2mobi - derived from fb2conv 1.5.4
Stars: ✭ 89 (-33.08%)
Mutual labels:  mobi, epub
Readteractive
Tool for writing and generating interactive books.
Stars: ✭ 23 (-82.71%)
Mutual labels:  mobi, epub
Asciidoctor Epub3
📘 Asciidoctor EPUB3 is a set of Asciidoctor extensions for converting AsciiDoc to EPUB3 & KF8/MOBI
Stars: ✭ 166 (+24.81%)
Mutual labels:  mobi, epub
Owasp Masvs
The Mobile Application Security Verification Standard (MASVS) is a standard for mobile app security.
Stars: ✭ 1,030 (+674.44%)
Mutual labels:  mobi, epub
Foliate
A simple and modern GTK eBook reader
Stars: ✭ 3,150 (+2268.42%)
Mutual labels:  mobi, epub
Koodo Reader
A modern ebook manager and reader with sync and backup capacities for Windows, macOS, Linux and Web
Stars: ✭ 2,938 (+2109.02%)
Mutual labels:  mobi, epub
Shirah Reader
RSVP speed reader, written in python.
Stars: ✭ 133 (+0%)
Mutual labels:  mobi, epub
Books
IT技术书籍文字版mobi epub格式
Stars: ✭ 131 (-1.5%)
Mutual labels:  mobi, epub
Ethereum Development With Go Book
📖 A little book on Ethereum Development with Go (golang)
Stars: ✭ 754 (+466.92%)
Mutual labels:  mobi, epub
bitcoin-development-with-go
[Work in Progress] A little book on Bitcoin Development with Go (golang)
Stars: ✭ 19 (-85.71%)
Mutual labels:  mobi, epub
Easybook
Book publishing as easy as it should be (built with Symfony components)
Stars: ✭ 744 (+459.4%)
Mutual labels:  mobi, epub
Lector
Qt based ebook reader
Stars: ✭ 1,218 (+815.79%)
Mutual labels:  mobi, epub
Google Sre Ebook
Google SRE Book Generator (EPUB/MOBI/PDF).
Stars: ✭ 578 (+334.59%)
Mutual labels:  mobi, epub
Open Publisher
Using Jekyll to create outputs that can be used as Pandoc inputs. In short - input markdown, output mobi, epub, pdf, and print-ready pdf. With a focus on fiction.
Stars: ✭ 242 (+81.95%)
Mutual labels:  mobi, epub
Lightnovel Crawler
Download and generate e-books from online sources.
Stars: ✭ 344 (+158.65%)
Mutual labels:  mobi, epub
Calibre Web
📚 Web app for browsing, reading and downloading eBooks stored in a Calibre database
Stars: ✭ 5,616 (+4122.56%)
Mutual labels:  mobi, epub
The Economist Ebooks
经济学人(含音频)、纽约客、自然、新科学人、卫报、科学美国人、连线、大西洋月刊、新闻周刊、国家地理等英语杂志免费下载、订阅(kindle推送),支持epub、mobi、pdf格式, 每周更新. The Economist 、The New Yorker 、Nature、The Atlantic 、New Scientist、The Guardian、Scientific American、Wired、Newsweek magazines, free download and subscription for kindle, mobi、epub、pdf format.
Stars: ✭ 3,471 (+2509.77%)
Mutual labels:  mobi, epub
Laravel Book
Up to date Epub, Mobi and PDF versions from the official Laravel Docs
Stars: ✭ 221 (+66.17%)
Mutual labels:  mobi, epub

kaf-cli

把txt文本转成epub电子书的命令行工具

功能

  • 傻瓜操作模式(把txt文件拖到kaf-cli.exe上面自动转换)
  • 自定义封面
  • 自动识别书名和章节(示例中所有用法都会自动识别)
  • 自动识别字符编码(自动解决中文乱码)
  • 自定义章节标题识别规则
  • 自动给章节正文生成加粗居中的标题
  • 自定义标题对齐方式
  • 段落自动识别
  • 段落自动缩进
  • 自定义段落缩进字数
  • 自定义段落间距
  • 自定义书籍语言
  • 知轩藏书格式文件名会自动提取书名和作者, 例: 《希灵帝国》(校对版全本)作者:远瞳.txt
  • 超快速(130章/s以上速度, 4000章30s不到)
  • 自动转为mobi格式

下载

使用方法

  1. 解压, 把小说直接拖到 kaf-cli.exe 文件上面
  2. 等转换完,目录下会生成epub、azw3、mobi文件
    • mobi格式需要有kindlegen才会生成(windows、mac版本已经自带)
  3. 自定义封面功能 在拖拽模式下, 如果目录下有cover.png文件会自动添加为封面、支持jpg、png格式, 如果需要指定其它文件或jpg格式需要使用命令行模式
  4. 其它自定义功能请用命令行模式

效果

效果图片 效果图片

命令行模式参数

Usage of kaf-cli.exe:
  -align string
        标题对齐方式: left、center、righ (default "center")
  -author string
        作者 (default "YSTYLE")
  -bookname string
        书名: 默认为txt文件名
  -bottom string
        段落间距(单位可以为em、px) (default "1em")
  -cover string
        封面图片 (default "cover.png")
  -filename string
        txt 文件名
  -format string
        书籍格式: all、epub、mobi、azw3 (default "all")
  -indent uint
        段落缩进字数 (default 2)
  -lang string
        设置语言: en,de,fr,it,es,zh,ja,pt,ru,nl。 环境变量KAF_CLI_LANG可修改默认值 (default "zh")
  -match string
        匹配标题的正则表达式, 不写可以自动识别, 如果没生成章节就参考教程。例: -match 第.{1,8}章 表示第和章字之间可以有1-8个任意文字 (default "自动匹配,可自定义")
  -max uint
        标题最大字数 (default 35)
  -out string
        输出文件名,不需要包含格式后缀
  -tips
        添加本软件教程 (default true)

PS: 在darwin(mac、osx)上-tips参数要设置为false的方法 kaf-cli -filename 小说.txt -tips=0

命令行模式说明

转换全职法师.txt, 并设置作者名为

# windows 10: win + s 搜索powershell 
cd d:/
d:/kaf-cli.exe -author 乱 -filename d:/全职法师.txt

# linux / mac下, 把kaf-cli-linux/kaf-cli-darwin重命名为kaf-cli, 放到用户目录
# 把小说和kaf-cli放到用户目录下,  打开终端执行
cd ~
./kaf-cli -author 乱 -filename ./全职法师.txt

# 如果kaf-cli放到path里了, 或者在aur安装的可以执行:
kaf-cli -author 乱 -filename ~/全职法师.txt

# 命令行的简单模式(功能和拖拽模式一样)
kaf-cli ~/全职法师.txt

自定义章节匹配规则

以下全部示例都可以自动识别,不需要自己设定标题格式了, 一般用上用上面的例子就行了

规则支持正则表达式, 要自定义标题格式参考以下几个例子, 以下例子小说都在D盘

自定义章节匹配, 章节格式为第x节:

d:/kaf-cli.exe -filename d:/ebbok.txt -match "第.{1,8}节"

自定义章节匹配, 章节格式为Section 1 ~ Section 100:

d:/kaf-cli.exe -filename d:/ebbok.txt -match "Section \d+"

自定义章节匹配, 章节格式为Chapter xxx:

d:/kaf-cli.exe -filename d:/ebbok.txt -match "Chapter .{1,8}"

在任意位置执行命令

  • windows
    • kaf-cli.exekindlegen.exec:/windows/下边
    • 以后可以把小说放任意目录,都可以很简单执行转换, 第一步只需要做一次, 以下为每次转换小说的操作,
      • 打开小说在的文件夹, 按住Shift键不放,鼠标右击文件夹空白位置
      • 在右键菜单选择 用命令行打开以PowerShell打开
      • 以上命令可以改为 kaf-cli.exe -filename 全职法师.txt, 现在可以不用写盘符了
  • linux(理论上mac也可以是这样的)
    • 软件可以放任意地方, 比如~/application/kaf-cli,在~/.bashrc~/.zshrc 最后一行添加 export PATH=$HOME/application:$PATH
    • 打开终端, 执行命令为: kaf-cli -filename ~/全职法师.txt

手动把书转为kindle的mobi格式

新版如果检测到有kindlegen程序时会自动转为mobi

  1. 下载kindlegen (github备份,官网已经不提供下载)
  2. 同样放到d:盘根目录下, 把epub拖拽到kindlegen.exe上面, 或执行以下命令转换
cd d:/
d:/kindlegen.exe d:/全职法师.epub
  1. 在d盘就能找到mobi文件,复制到kindle的documents目录下,打开kindle就能看到小说了
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].