Blog

Blog

PHODAL

gitbook 制作书籍

偶然间看到到处都有:GitBook:使用Git+Markdown快速制作电子书,就试试这个,问题是和git有关系么?如果真有关系的话,他会默认把链接加到你的github上的库中。

gitbook 目录

一个简单的示例如官网所示

# Summary

* [Basics](basics/README.md)
    * [Comments](basics/comments.md)
    * [Variables](basics/variables.md)
    * [Types](basics/types.md)
* [Numbers](numbers/README.md)
    * [Creation](numbers/create.md)
    * [Basic Operators](numbers/operators.md)
    * [Advanced Operators](numbers/advanced.md)
* [Strings](strings/README.md)
    * [Creation](strings/create.md)
    * [Concatenation](strings/concat.md)
    * [Length](strings/length.md)
* [Conditional Logic](conditional/README.md)
    * [If](conditional/if.md)
    * [Else](conditional/else.md)
    * [Comparators](conditional/comparators.md)
    * [Concatenate](conditional/concatenate.md)
* [Loops](loops/README.md)
    * [For](loops/for.md)
    * [While](loops/while.md)
* [Functions](functions/README.md)
    * [Declare](functions/declare.md)
    * [Higher order](functions/higher_order.md)

这是我之前给be a geek写的内容,可以 https://github.com/gmszone/beageek上面大致就是那些内容,至于目录

# Summary

* [HJC](content.md)
    * [无处不在的HTML](chapter1/anywhere-html.md)
    * [无处不在的Javascript](chapter2/anywhere-javascript.md)
    * [无处不在的CSS](chapter3/anywhere-css.md)   
* [Anywhere](content.md)
    * [无处不在](chapter4/anywhere-hjc.md)
    * [Simple Python](chapter5/simple-python.md)
    * [C](gcc/gcc.md)
    * [DIP](oo/dip/dip.md)
    * [End](tw/thoughtworks.md)

gitbook 添加内容

[]里面的就是标题,后面的是markdown的位置,需要注意的是

不能有和文件名一样的html文件

如在chapter1下面不能有一个anywhere-html.html

gitbook github结合

 gitbook build

会生成 _book目录,里面的文件,可以让我们用github上的gh-pages也就是生成一个在线版的http://gmszone.github.io/beageek

在本地我们可以用

 gitbook server

访问

 http://localhost:4000

gitbook pdf生成

运行

     gitbook pdf

便可以得到我们想要的pdf,当然还需要安装好gitbook-pdf

      sudo npm install gitbook-pdf -g

只是似乎没有pandoc好玩。

pandoc markdown转docx,pdf

gitbook 电子书

最后HTML版如右图所示

html book

注意

今天的gitbook是一个协作平台。


或许您还需要下面的文章:

关于我

Github: @phodal     微博:@phodal     知乎:@phodal    

微信公众号(Phodal)

围观我的Github Idea墙, 也许,你会遇到心仪的项目

QQ技术交流群: 321689806
comment

Feeds

RSS / Atom

最近文章

关于作者

Phodal Huang

Engineer, Consultant, Writer, Designer

ThoughtWorks 技术专家

工程师 / 咨询师 / 作家 / 设计学徒

开源深度爱好者

出版有《前端架构:从入门到微前端》、《自己动手设计物联网》、《全栈应用开发:精益实践》

联系我: h@phodal.com

微信公众号: 最新技术分享

标签