资料源自:维基文库
本仓库主要负责基于文库生成各种PDF/MOBI格式的书籍。
基于Gitbook + Markdwon 来生成电子书籍,排版请参考:中文文档排版指南。
如果需要在本地预览以及生成PDF,则需要安装 Gitboook 和 Calibre Ebook Converter,请参考下文。
请自行前往官网:https://nodejs.org/zh-cn/download ,下载GA版本,点击安装。
在控制台执行以下命令:
npm install gitbook-cli -g
有可能速度较慢,建议翻墙(全局代理)。
# 首次执行建议安装插件,后面可不执行此行命令
gitbook install
# 启动web服务器,浏览器里访问:http://localhost:4000
gitbook serve
GitBook can generates a website, but can also output content as ebook (ePub, Mobi, PDF).
# 切换到书籍根目录
# Generate a PDF file
$ gitbook pdf ./ ./文史-长短经-赵蕤.pdf
# Generate an ePub file
$ gitbook epub ./ ./文史-长短经-赵蕤.epub
# Generate a Mobi file
$ gitbook mobi ./ ./文史-长短经-赵蕤.mobi
ebook-convert
is required to generate ebooks (epub, mobi, pdf).
请自行前往官网下载:https://calibre-ebook.com/download
Download the Calibre application. After moving the calibre.app
to your Applications folder create a symbolic link to the ebook-convert tool:
$ sudo ln -s ~/Applications/calibre.app/Contents/MacOS/ebook-convert /usr/bin
You can replace /usr/bin
with any directory that is in your $PATH.
MacOS 无法创建快捷方式的解决方法请参考:cannot-create-a-symlink-inside-of-usr-bin-even-as-sudo
Covers are used for all the ebook formats. You can either provide one yourself, or generate one using the autocover plugin.
To provide a cover, place a cover.jpg
file at the root directory of your book. Adding a cover_small.jpg
will specify a smaller version of the cover. The cover should be a JPEG file.
A good cover should respect the following guidelines:
- Size of 1800x2360 pixels for
cover.jpg
, 200x262 forcover_small.jpg
- No border
- Clearly visible book title
- Any important text should be visible in the small version