mirror of
https://github.com/kaka111222333/kaka111222333.github.io.git
synced 2025-12-17 15:25:10 +08:00
update blog
This commit is contained in:
@@ -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/ )许可协议。
|
||||
|
||||
### 致谢
|
||||
|
||||
|
||||
@@ -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的预览生成。也可本地预览,甚至生成各种格式文档输出的强大工具。
|
||||
|
||||
<!-- more -->
|
||||
|
||||
@@ -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 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
|
||||

|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 生成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的配置界面已经发生了变化,新界面操作如下:**
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
### 发布到github pages
|
||||
#### 关于 GitHub Pages
|
||||
@@ -70,12 +76,16 @@ gitbook builid --debug //输出错误信息
|
||||
项目站点的源文件与其项目存储在同一个仓库中。 除非您使用自定义域,否则项目站点位于 http(s)://<user>.github.io/<repository> 或 http(s)://<organization>.github.io/<repository>。
|
||||
[更多](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 目录
|
||||
|
||||

|
||||
|
||||
- 创建gh-pages分支,并且删除不需要的文件,仅保留git目录和 _book目录
|
||||
> $ git checkout --orphan gh-pages
|
||||
$ git rm --cached -r .
|
||||
|
||||
2
about.md
2
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/ )许可协议。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user