gitbook命令
安装gitbook命令
前提:已经安装nodejs
npm install -g gitbook-cli
查看版本号
gitbook -V
gitbook命令
gitbook -h
Usage: gitbook [options] [command]
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
Options:
-h, --help output usage information
-v, --gitbook [version] specify GitBook version to use
-d, --debug enable verbose error
-V, --version Display running versions of gitbook and gitbook-cli
gitbook help
build [book] [output] 编译指定目录,输出Web格式,输出一个静态网站到目录[output]
--log Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)
--format Format to build to (Default is website; Values are website, json, ebook)
--[no-]timing Print timing debug information (Default is false)
serve [book] [output] 启动本地server预览localhost:4000
--port Port for server to listen on (Default is 4000)
--lrport Port for livereload server to listen on (Default is 35729)
--[no-]watch Enable file watcher and live reloading (Default is true)
--[no-]live Enable live reloading (Default is true)
--[no-]open Enable opening book in browser (Default is false)
--browser Specify browser for opening book (Default is )
--log Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)
--format Format to build to (Default is website; Values are website, json, ebook)
install [book] install all plugins dependencies
--log Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)
parse [book] parse and print debug information about a book
--log Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)
init [book] setup and create files for chapters 初始化一个新的gitbook目录
--log Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)
pdf [book] [output] build a book into an ebook file 编译为PDF格式并输出
--log Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)
epub [book] [output] build a book into an ebook file 编译为epub格式并输出
--log Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)
mobi [book] [output] build a book into an ebook file 编译为mobi格式并输出
--log Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)
开始写
从gitbook直接克隆到本地开始写
会自动生成chapter1.md,可以删除也可以直接修改名称,编辑完后直接提交
在本地已编辑好书后,提交到远程gitbook仓库
- 拿到提交的地址,如果为新书,则先新建gitbook然后拿到地址
git init该目录- 添加远程地址
git remote add gitbook https://push.gitbook.io/username/book-name.git
注:如果是用第三方登录,如github, twitter等,要先到账户设置中设置用户名和密码用于验证。
发布
git add
git commit
git push
安装插件
更换主题
在npm上面搜索gitbook-theme。安装主题和安装插件一样安装。
- 通过npm搜索出来的结果提示安装
npm install gitbook-theme-maxiang - 根目录新建一个文件book.json,选项参见
{
"plugins": ["thePlugin"]
}
- 运行
gitbook install安装json文件中的所有插件 gitbook serve预览
可以删除npm下载下来的主题文件夹,_book保留提交,会生成的新的样式文件。
更换封面
错误集锦
1 在启动gitbook serve时,报错:
TypeError: Path must be a string. Received undefined
不是真的路径有错误,而是该文件里面的内容有无法识别,转换为html格式文件。文件里面的HTML标签一定要放在代码块里面。
2 read时只显示其中一部分的内容
可能在写中间某个文件时,里面有无法生成html格式的内容,导致之后的文件都没有编译成功。
gitbook命令的更多相关文章
- Gitbook 命令行工具
1.Gitbook 简介 1.1 Gitbook GitBook 是一个基于 Node.js 开发的命令行工具,使用它可以很方便的管理电子书,GitBook 是目前最流行的开源书籍写作方案. 使用 G ...
- GItBook命令使用(持续更新)
GitBook基本命令 gitbook init //初始化目录文件 gitbook help //列出gitbook所有的命令 gitbook --help //输出gitbook-cli的帮助信息 ...
- GitBook制作电子书详细教程(命令行版)
GitBook 是一款基于 Node.js 开发的开源的工具,可以通过命令行的方式创建电子书项目,再使用 MarkDown 编写电子书内容,然后生成 PDF.ePub.mobi 格式的电子书,或生成一 ...
- gitbook 入门教程之常用命令详解
不论是 gitbook-cli 命令行还是 gitbook editor 编辑器都离不开 gitbook 命令的操作使用,所以再次了解下常用命令. 注意 gitbook-cli 是 gitbook 的 ...
- Gitbook简易教程
简介 GitBook 是一个基于 Node.js 的命令行工具,可使用 Github/Git 和 Markdown 来制作精美的电子书.GitBook支持输出以下几种文档格式 静态站点:GitBook ...
- 使用 Gitbook 打造你的电子书
本文详细讲解了 Gitbook 生成电子书的完整过程,内容包括:安装.命令.配置.文档结构.生成电子书.部署. 限于篇幅,本文不介绍任何 Gitbook 定制化页面的内容. 想看看 Gitbook 在 ...
- gitbook 入门教程之快速体验
本文主要介绍三种使用 gitbook 的方式,分别是 gitbook 命令行工具,Gitbook Editor 官方编辑器和 gitbook.com 官网. 总体来说,三种途径适合各自不同的人群,找到 ...
- gitbook 入门教程之环境要求
gitbook 是基于 node.js 的命令行工具,首先需要安装并配置好 node.js 环境,然后才能安装gitbook 相关工具. 由于安装工具全部都是国外网站,因此速度可能会很慢,也可能需要F ...
- gitbook的学习
gitbook安装与使用之windows下搭建gitbook平台 最近需要在GitBook中去阅读电子书 安装nodejs cnpm安装gitbook 解压书籍文件,并cd到书籍文件目录 gitboo ...
随机推荐
- C# 获取基类或者接口的所有继承类方法
static class ReflectionHelper { public static IEnumerable<T> CreateAllInstancesOf<T>() { ...
- 【前端词典】这些功能其实不需要 JS,CSS 就能搞定
前言 今天我们大家介绍一些你可能乍一眼以为一定需要 JavaScript 才能完成的功能,其实 CSS 就能完成,甚至更加简单. 内容已经发布在 gitHub 了,欢迎围观 Star,更多文章都在 g ...
- vue基础指令学习
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- R语言基本操作
is.na and is.element is.na can use which, it finds specific rows, is.element can't, it is designed t ...
- 纯干货 C# 通过 RFC_READ_TABLE 读取 SAP TABLE
SAP系统又称企业管理解决方案,是全球企业管理软件与解决方案的技术领袖,同时也是市场领导者.通过其应用软件.服务与支持,SAP持续不断向全球各行业企业提供全面的企业级管理软件解决方案. 在实际开发过程 ...
- opnet
一.修改默认的文件管理 1.以管理员身份运行 opnet14.5 2. 3.初始默认是c盘下的op_madels 4.修改你默认的文件夹 二. 1.创建一个空场景 包含Manet模型 2. 出错 二. ...
- ElasticSearch、IK分词器、Head Master安装-----Windows
一.下载 地址:https://www.elastic.co/cn/downloads/elasticsearch 历史版本:找到下面这句话 然后双击 Not the version you're l ...
- 1016 Phone Bills (25 分)
A long-distance telephone company charges its customers by the following rules: Making a long-distan ...
- Linux基础:Day02
Linux文件管理 创建 touch vim/vi echo重定向 touch 管理:atime mtime ctime touch 文件名 //如果文件不存在就创建文件 touch -a -t [ ...
- 原来rollup这么简单之插件篇
大家好,我是小雨小雨,致力于分享有趣的.实用的技术文章. 内容分为翻译和原创,如果有问题,欢迎随时评论或私信,希望和大家一起进步. 大家的支持是我创作的动力. 计划 rollup系列打算一章一章的放出 ...