update blog

This commit is contained in:
lemonchann
2019-11-19 01:00:22 +08:00
parent 0869ae4240
commit 05bb9b29fb
3 changed files with 33 additions and 23 deletions

View File

@@ -2,7 +2,7 @@ lemonchann的个人博客仓库。
### 文章版权 ### 文章版权
**[_posts](https://github.com/lemonchann/lemonchann.github.io/tree/master/_posts)** 文件夹内所有文章版权均属于列出的文章author遵循License: **CC BY-NC-SA 署名-非商业性使用-相同方式共享** **[_posts](https://github.com/lemonchann/lemonchann.github.io/tree/master/_posts)** 文件夹内所有文章若无特别声明均采用: [**CC BY-NC-SA 署名-非商业性使用-相同方式共享**]( https://creativecommons.org/licenses/ )许可协议。
### 致谢 ### 致谢

View File

@@ -5,11 +5,12 @@ date: 2019-11-18
tags: [tool] tags: [tool]
comments: true comments: true
author: lemonchann author: lemonchann
--- ---
## 什么是Gitbook ## 什么是Gitbook
简单说就是可以把用md写的多个文档组织成发布md你可以放在github管理配置gitbook关联github可以实现实时commite的预览生成。也可本地预览,甚至生成各种格式文档输出的强大工具。 简单说就是可以把用md写的多个文档组织成**书**发布md你可以放在github管理配置gitbook关联github可以实现实时commit的预览生成。也可本地预览甚至生成各种格式文档输出的强大工具。
<!-- more --> <!-- more -->
@@ -17,30 +18,34 @@ author: lemonchann
* 安装nodejs可以去[官网](http://nodejs.cn/download/)下载对应版本 * 安装nodejs可以去[官网](http://nodejs.cn/download/)下载对应版本
* 安装gitbook打开win cmd输入npm install gitbook-cli -g * 安装gitbook打开win cmd输入npm install gitbook-cli -g
> 常用命令: > 常用命令:
**gitbook -V 查看版本** > **gitbook -V 查看版本**
**gitbook serve 生成网页localhost:4000预览** - 命令输入要进到SUMMARY.md所在目录 > **gitbook serve 生成网页localhost:4000预览** - 命令输入要进到SUMMARY.md所在目录![gitbook_serve](https://github.com/lemonchann/lemonchann.github.io/raw/master/images/2019-11-18-new_gitbook_tutors/gitbook_serve.png)
gitbook init //初始化目录文件 > gitbook init //初始化目录文件
gitbook help //列出gitbook所有的命令 > gitbook help //列出gitbook所有的命令
gitbook --help //输出gitbook-cli的帮助信息 > gitbook --help //输出gitbook-cli的帮助信息
gitbook build //生成静态网页 > gitbook build //生成静态网页
gitbook serve //生成静态网页并运行服务器 > gitbook serve //生成静态网页并运行服务器
gitbook build --gitbook=2.0.1 //生成时指定gitbook的版本, 本地没有会先下载 > gitbook build --gitbook=2.0.1 //生成时指定gitbook的版本, 本地没有会先下载
gitbook ls //列出本地所有的gitbook版本 > gitbook ls //列出本地所有的gitbook版本
gitbook ls-remote //列出远程可用的gitbook版本 > gitbook ls-remote //列出远程可用的gitbook版本
gitbook fetch 标签/版本号 //安装对应的gitbook版本 > gitbook fetch 标签/版本号 //安装对应的gitbook版本
gitbook update //更新到gitbook的最新版本 > gitbook update //更新到gitbook的最新版本
gitbook uninstall 2.0.1 //卸载对应的gitbook版本 > gitbook uninstall 2.0.1 //卸载对应的gitbook版本
gitbook build --log=debug //指定log的级别 > gitbook build --log=debug //指定log的级别
gitbook builid --debug //输出错误信息 > gitbook builid --debug //输出错误信息
## 用Gitbook转换markdown文件生成PDF ## 用Gitbook转换markdown文件生成PDF
### 安装calibre ### 安装calibre
* 电子书生成下载依赖calibre否则会报错建议先安装[下载地址](https://calibre-ebook.com/download) * 电子书生成下载依赖calibre否则会报错建议先安装[下载地址](https://calibre-ebook.com/download)
* 配置calibre环境变量我的目录是C:\Program Files\Calibre2 * 配置calibre环境变量我的目录是C:\Program Files\Calibre2
![hhuanj](https://raw.githubusercontent.com/lemonchann/cloud_image/master/gitbook/%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE1.PNG)
![](https://github.com/lemonchann/cloud_image/raw/master/gitbook/%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE2.PNG) ![环境变量设置1](https://github.com/lemonchann/lemonchann.github.io/raw/master/images/2019-11-18-new_gitbook_tutors/%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE1.PNG)
![环境变量设置2](https://github.com/lemonchann/lemonchann.github.io/raw/master/images/2019-11-18-new_gitbook_tutors/%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE2.PNG)
### 生成PDF ### 生成PDF
打开win cmd命令行到SUMMARY.md所在目录执行 **gitbook pdf 生成pdf** 打开win cmd命令行到SUMMARY.md所在目录执行 **gitbook pdf 生成pdf**
> 转换PDF失败原因 > 转换PDF失败原因
1. 没有安装calibre 1. 没有安装calibre
@@ -48,11 +53,12 @@ gitbook builid --debug //输出错误信息
3. [报错1](http://xcoding.tech/2018/08/08/hexo/%E5%A6%82%E4%BD%95%E4%BB%8E%E6%A0%B9%E6%9C%AC%E8%A7%A3%E5%86%B3hexo%E4%B8%8D%E5%85%BC%E5%AE%B9%7B%7B%7D%7D%E6%A0%87%E7%AD%BE%E9%97%AE%E9%A2%98/) 3. [报错1](http://xcoding.tech/2018/08/08/hexo/%E5%A6%82%E4%BD%95%E4%BB%8E%E6%A0%B9%E6%9C%AC%E8%A7%A3%E5%86%B3hexo%E4%B8%8D%E5%85%BC%E5%AE%B9%7B%7B%7D%7D%E6%A0%87%E7%AD%BE%E9%97%AE%E9%A2%98/)
## Gitbook关联github ## Gitbook关联github
**Gitbook上同步github的配置界面已经发生了变化新界面操作如下:** **Gitbook上同步github的配置界面已经发生了变化新界面操作如下:**
![gitbook空间](https://github.com/lemonchann/cloud_image/raw/master/gitbook/gitbook%E7%A9%BA%E9%97%B4.png) ![gitbook空间](https://github.com/lemonchann/lemonchann.github.io/raw/master/images/2019-11-18-new_gitbook_tutors/gitbook%E7%A9%BA%E9%97%B4.png)
![gitbook关联github](https://github.com/lemonchann/cloud_image/raw/master/gitbook/%E5%85%B3%E8%81%94github.png) ![关联github](https://github.com/lemonchann/lemonchann.github.io/raw/master/images/2019-11-18-new_gitbook_tutors/%E5%85%B3%E8%81%94github.png)
### 发布到github pages ### 发布到github pages
#### 关于 GitHub Pages #### 关于 GitHub Pages
@@ -75,7 +81,11 @@ gitbook builid --debug //输出错误信息
- gh-pages, 保存书籍编译后的 HTML 文件 - gh-pages, 保存书籍编译后的 HTML 文件
**步骤:** **步骤:**
- `gitbook build` 将书籍内容输出到默认目录,也就是当前目录下的 _book 目录 - `gitbook build` 将书籍内容输出到默认目录,也就是当前目录下的 _book 目录
![gitbook_pdf](https://github.com/lemonchann/lemonchann.github.io/raw/master/images/2019-11-18-new_gitbook_tutors/gitbook_pdf.png)
- 创建gh-pages分支并且删除不需要的文件,仅保留git目录和 _book目录 - 创建gh-pages分支并且删除不需要的文件,仅保留git目录和 _book目录
> $ git checkout --orphan gh-pages > $ git checkout --orphan gh-pages
$ git rm --cached -r . $ git rm --cached -r .

View File

@@ -16,5 +16,5 @@ Linux后端分布式高性能服务开发C++熟练工PythonGo
### 版权声明 ### 版权声明
博客文章存档于**[此处](https://github.com/lemonchann/lemonchann.github.io/tree/master/_posts)** ,所有文章版权均属于文章正文author遵循License: **CC BY-NC-SA 署名-非商业性使用-相同方式共享** 博客文章存档于**[此处](https://github.com/lemonchann/lemonchann.github.io/tree/master/_posts)** ,所有文章若无特别声明均采用: [**CC BY-NC-SA 署名-非商业性使用-相同方式共享**]( https://creativecommons.org/licenses/ )许可协议