Gitbook环境搭建及制作——2019年10月24日
1.gitbook介绍
GitBook 是一个基于 Node.js 的命令行工具,支持 Markdown 和 AsciiDoc 两种语法格式,可以输出 HTML、PDF、eBook 等格式的电子书。可以把 GitBook 定义为文档格式转换工具。
所以,GitBook 不是 Markdown 编辑工具,也不是 Git 版本管理工具。市面上我们可以找到很多 Markdown 编辑器,比如 Typora、MacDown、Bear、MarkdownPad、MarkdownX、JetBrains’s IDE(需要安装插件)、Atom、简书、CSDN 以及 GitBook 自家的 GitBook Editor 等等。

但 GitBook 又与 Markdown 和 Git 息息相关,因为只有将它们结合起来使用,才能将它们的威力发挥到极致!因此,通常我们会选择合适的 Markdown 编辑工具以获得飞一般的写作体验;使用 GitBook 管理文档,预览、制作电子书;同时通过 Git 管理书籍内容的变更,并将其托管到云端(比如 GitHub、GitLab、码云,或者是自己搭建的 Git 服务器),实现多人协作。
实际上,GitBook Editor 对于新手来说是个不错的选择,它集成了 GitBook、Git、Markdown 等功能,还支持将书籍同步到 gitbook.com 网站,使我们可以很方便地编辑和管理书籍。
2.安装gitbook
#npm install -g gitbook-cli
#gitbook
gitbook
Usage: gitbook [options] [command]
Options:
-v, --gitbook [version] specify GitBook version to use
-d, --debug enable verbose error
-V, --version Display running versions of gitbook and gitbook-cli
-h, --help output usage information
Commands:
ls List versions installed locally
current Display currently activated version
ls-remote List remote versions available for install
fetch [version] Download and install a <version>
alias [folder] [version] Set an alias named <version> pointing to <folder>
uninstall [version] Uninstall a version
update [tag] Update to the latest version of GitBook
help List commands for GitBook
* run a command with a specific gitbook version
推荐的是 GitBook + Typora + Git,需要安装 Typora和 Git 版本管理工具。
3.使用
初始化
gitbook init
apple$ gitbook init
warn: no summary file in this book
info: create README.md
info: create SUMMARY.md
info: initialization is finished
修改SUMMARY.md
# Summary
* [前言](README.md)
* [第一章](Chapter1/README.md)
* [第1节:衣](Chapter1/衣.md)
* [第2节:食](Chapter1/食.md)
* [第3节:住](Chapter1/住.md)
* [第4节:行](Chapter1/行.md)
* [第二章](Chapter2/README.md)
* [第三章](Chapter3/README.md)
* [第四章](Chapter4/README.md)
再次gitbook init
本地起服务
gitbook serve
访问链接
localhost:4000
gitbook serve --port 2333

4.生成pdf
生成 PDF 格式的电子书
gitbook pdf ./ ./mybook.pdf
ryks-MacBook-Pro-4:gitbook_collections apple$ gitbook pdf ./ ./mybook.pdf
info: 7 plugins are installed
info: 6 explicitly listed
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 9 pages
info: found 0 asset files
info: >> generation finished with success in 5.4s !
info: >> 1 file(s) generated
生成 epub 格式的电子书
gitbook epub ./ ./mybook.epub
生成 mobi 格式的电子书
gitbook mobi ./ ./mybook.mobi
4.1 提醒缺少组件
InstallRequiredError: “ebook-convert” is not installed.
1.下载calibre,并链接
ln -s /Applications/calibre.app/Contents/MacOS/ebook-convert /usr/local/bin
2.在线下载
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"
Installing to /opt/calibre
Downloading tarball signature securely...
Will download and install calibre-4.2.0-x86_64.txz
Downloading calibre-4.2.0-x86_64.txz
0% [-------------------------------------------------------]
2019年10月24日20:17:34
Gitbook环境搭建及制作——2019年10月24日的更多相关文章
- SPSS 2019年10月24日 今日学习总结
2019年10月24日今日课上内容1.SPSS掌握基于键值的一对多合并2.掌握重构数据3.掌握汇总功能 内容: 1.基于键值的一对多合并 合并文件 添加变量 合并方法:基于键值的一对多合并 变量 2. ...
- 易初大数据 2019年10月24日 spss笔记 王庆超
数据文件的重置结构:横向结构(个案组),纵向结构,不符合分析方法的时候就需要重组,选定变量重组为个案,数据—重构,重构数据向导,选定变量重组为个案,将选定个案重构位变量,转置所有数据,变量组数目,一个 ...
- ;~ 小部分AutoHotkey源代码片段测试模板2019年10月9日.ahk
;~ 小部分AutoHotkey源代码片段测试模板2019年10月9日.ahk ;~ 此脚本用于测试执行一行或多行AHK脚本源代码的效果;~ 此脚本最后修改于2019年9月22日20时03分;~ 把此 ...
- 开机时自动启动的AutoHotkey脚本 2019年10月09日
;;; 开机时自动启动的AutoHotkey脚本 2019年10月09日;; http://www.autoahk.com/archives/16600; https://www.cnblogs.co ...
- 等Excel工作簿关闭后自动加密压缩备份2019年10月9日.ahk
;; 等Excel工作簿关闭后自动加密压缩备份2019年10月9日.ahk;; 腾讯QQ号 595076941; 作者:徐晓亮(weiyunwps618); 写作日期:2019年5月15日; 版本号: ...
- 终端、mac等小技巧——2019年10月18日
1.新建finder窗口 cmd+N 2.查看文件夹结构 brew install tree tree命令行参数(只实用与安装了tree命令行工具): -a 显示所有文件和目录. -A 使用ASNI绘 ...
- mac文本操作小技巧——2019年10月17日
声明:看的别人博主写的,自己整理的,非原创,只是自用. mac文本操作技巧 官方指导文档:https://support.apple.com/zh-cn/HT201236 1.光标移动 1.1 行首. ...
- Linux自用指令——2019年10月23日
1.ls ls命令是列出目录内容(List Directory Contents)的意思.运行它就是列出文件夹里的内容,可能是文件也可能是文件夹. ls -a 列出目录所有文件,包含以.开始的隐藏文件 ...
- 36.React基础介绍——2019年12月24日
2019年12月24日16:47:12 2019年10月25日11:24:29 主要介绍react入门知识. 1.jsx语法介绍 1.1 介绍 jsx语法是一种类似于html标签的语法,它的作用相当于 ...
随机推荐
- kibana使用日志时间进行排序
kibana默认的是按照客户端的采集时间(@timestamp)进行排序,这往往不是我们所需要的,我们需要的是对日志实际时间进行排序,要解决这个问题,有很多种方法,可以在elasticsearch建立 ...
- linux centos添加yum镜像
下载配置文件,加入/etc/yum.repos.d/阿里镜像:http://mirrors.aliyun.com/repo/Centos-7.repo网易镜像:http://mirrors.163.c ...
- easyui for jquery之tooltip
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 170817关于JSON知识点
1. JSON [1] JSON简介 JSON全称 JavaScript Object Notation ...
- LR分析Analysis火车票
一.分析结果 1 研究 Vuser 的行为(F:\JMeter\0Tutorial-SCR\机票预订\机票_analysis-session) 筛选该图,仅查看所有 Vuser 同时运行的时间段 右键 ...
- ruby的实例变量
class Box def initialize(w,h) @width,@height=w,h end def getArea @height*@width end end class BigBox ...
- Vagrant 手册之 Vagrantfile - Vagrant 设置 config.vagrant
原文地址 配置的命名空间:config.vagrant config.vagrant 中的设置修改 Vagrant 自身的行为. 1. 可用设置 config.vagrant.host 设置运行 Va ...
- CodeForce-1196D2-RGB Substring (hard version)
原题链接 题目大意与上题完全一样,只是数据规模更大. 思路: 再用上题的暴力肯定TLE,所以需要优化一下搜索过程.上一题我们是外层遍历n,内层遍历3种情况.这题我们外层遍历3种情况,内层遍历数组,记录 ...
- CentOS7和Ubuntu18.10下运行Qt Creator出现cannot find -lGL的问题的解决方案
解决方法:缺少相应的opengl的库,需要安装opengl库 一.Ubuntu下解决Qt5.11.1 cannot find -lGL 有两种原因: 一种是没有按照libGL库,那么就安装: sudo ...
- 什么是SpringMvc
1.什么是SpringMvc? SpringMvc是spring的一个模块 基于MVC的一个框架 无需中间整合层来整合 什么是MVC ?mvc在b/s下的应用: 首先请求发送request请求到C(c ...