From 05bb9b29fb32c3a42624045ae49cba338f28e83d Mon Sep 17 00:00:00 2001 From: lemonchann Date: Tue, 19 Nov 2019 01:00:22 +0800 Subject: [PATCH] update blog --- README.md | 2 +- _posts/2019-11-18-new_gitbook_tutors.md | 52 +++++++++++++++---------- about.md | 2 +- 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index b072397..b350022 100644 --- a/README.md +++ b/README.md @@ -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/ )许可协议。 ### 致谢 diff --git a/_posts/2019-11-18-new_gitbook_tutors.md b/_posts/2019-11-18-new_gitbook_tutors.md index 8c9933e..9bc29b0 100644 --- a/_posts/2019-11-18-new_gitbook_tutors.md +++ b/_posts/2019-11-18-new_gitbook_tutors.md @@ -5,11 +5,12 @@ date: 2019-11-18 tags: [tool] comments: true author: lemonchann + --- ## 什么是Gitbook -简单说就是可以把用md写的多个文档组织成书发布,md你可以放在github管理,配置gitbook关联github可以实现实时commite的预览生成。也可本地预览,甚至生成各种格式文档输出的强大工具。 +简单说就是可以把用md写的多个文档组织成**书**发布,md你可以放在github管理,配置gitbook关联github可以实现实时commit的预览生成。也可本地预览,甚至生成各种格式文档输出的强大工具。 @@ -17,30 +18,34 @@ author: lemonchann * 安装nodejs可以去[官网](http://nodejs.cn/download/)下载对应版本 * 安装gitbook,打开win cmd输入npm install gitbook-cli -g > 常用命令: -**gitbook -V 查看版本** -**gitbook serve 生成网页localhost:4000预览** - 命令输入要进到SUMMARY.md所在目录 -gitbook init //初始化目录文件 -gitbook help //列出gitbook所有的命令 -gitbook --help //输出gitbook-cli的帮助信息 -gitbook build //生成静态网页 -gitbook serve //生成静态网页并运行服务器 -gitbook build --gitbook=2.0.1 //生成时指定gitbook的版本, 本地没有会先下载 -gitbook ls //列出本地所有的gitbook版本 -gitbook ls-remote //列出远程可用的gitbook版本 -gitbook fetch 标签/版本号 //安装对应的gitbook版本 -gitbook update //更新到gitbook的最新版本 -gitbook uninstall 2.0.1 //卸载对应的gitbook版本 -gitbook build --log=debug //指定log的级别 -gitbook builid --debug //输出错误信息 +> **gitbook -V 查看版本** +> **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 help //列出gitbook所有的命令 +> gitbook --help //输出gitbook-cli的帮助信息 +> gitbook build //生成静态网页 +> gitbook serve //生成静态网页并运行服务器 +> gitbook build --gitbook=2.0.1 //生成时指定gitbook的版本, 本地没有会先下载 +> gitbook ls //列出本地所有的gitbook版本 +> gitbook ls-remote //列出远程可用的gitbook版本 +> gitbook fetch 标签/版本号 //安装对应的gitbook版本 +> gitbook update //更新到gitbook的最新版本 +> gitbook uninstall 2.0.1 //卸载对应的gitbook版本 +> gitbook build --log=debug //指定log的级别 +> gitbook builid --debug //输出错误信息 ## 用Gitbook转换markdown文件生成PDF + ### 安装calibre * 电子书生成下载依赖calibre否则会报错,建议先安装,[下载地址](https://calibre-ebook.com/download) * 配置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 + 打开win cmd命令行,到SUMMARY.md所在目录执行 **gitbook pdf 生成pdf** > 转换PDF失败原因: 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/) ## 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 @@ -70,12 +76,16 @@ gitbook builid --debug //输出错误信息 项目站点的源文件与其项目存储在同一个仓库中。 除非您使用自定义域,否则项目站点位于 http(s)://.github.io/ 或 http(s)://.github.io/。 [更多](https://help.github.com/cn/github/working-with-github-pages/about-github-pages) - #### [这里](http://www.chengweiyang.cn/gitbook/github-pages/README.html)也包含推送到**github.page**的方法 +#### [这里](http://www.chengweiyang.cn/gitbook/github-pages/README.html)也包含推送到**github.page**的方法 - master, 保存书籍的源码 - gh-pages, 保存书籍编译后的 HTML 文件 **步骤:** + - `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目录 > $ git checkout --orphan gh-pages $ git rm --cached -r . diff --git a/about.md b/about.md index c14eb12..14bbd84 100644 --- a/about.md +++ b/about.md @@ -16,5 +16,5 @@ Linux后端分布式高性能服务开发,C++熟练工,Python,Go ### 版权声明 -博客文章存档于**[此处](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/ )许可协议。