A command line tool to generate a SUMMARY.MD from a folder。Demo 中文文档
- Generate
SUMMARY.mdby using a CLI with some options - Setting with
book.json - Link
README.mdto the parent directory - Only get '.md' files
- Order by alphabet or numbers
- ...
Source directory:
sources ├── 1-FirstChapter // The first chapter,format: {orderNumber or alphabet}-{chapterName}.md ├────── 1-FirstDocument.md ├────── 5-SecondDocument.md // concentrating solely on the order, not the numbers. ├── 3-SecondChapter // Focus only on the order, not the numbers. ├────── 1-FirstDocumentOfSecondChapter.md ├────── 2-SecondDocumentOfSecondChapter.md ├── 7-ThirdChapter ├── FourthChapter // May have no order ├── README.md // In addition to readme.md, not to put other markdown documents └── book.json // Set up the book npm install -g gitbook-summary 1> Generate a SUMMARY.md Simply
$ cd /path/to/your/book/ $ book sm or, For example:
$ book sm -r ../sailsjs-docs-gitbook/en -i 0home -u 'myApp' -c 'concepts, reference, userguides' -n "Sails.js 官方文档(中英合辑)" Note: -s or --sortedBy can not be given -, commander.js will parse it an option. But you can set it in book.json as follow.
2> Create a book.json in the book`s root folder
for example:
// test/books/config-json/book.json { "bookname": "json-config-name", "outputfile": "test.md", "catalog": "all", // or [chapter1,chapter2, ...] "ignores": [], //Default: '.*', '_book'... "unchanged": [], // for example: ['myApp'] -> `myApp` not `My App` "sortedBy": "-" } then, you can do:
$ book sm You will get a test.md file:
3> Get a markdown artical from a html file or a remote url
$ book md -l "http://book.btcnodejs.com/index.html" -s "div.className" You will get the 'index.html' and 'index.md'.
4> Get convert between zh and zh-tw, zh-hk, or zh-sg
$ book cv -f ./test/language/test.md -l zh-tw -t "./test/language/test2.md" - 《Nodejs开发加密货币》: https://github.com/imfly/bitcoin-on-nodejs
- 《用Gitbook和Github轻松搭建自出版平台》: https://github.com/imfly/how-to-create-self-publishing-platform
- 《sails.js 官方文档 多语言电子书》:https://github.com/imfly/sailsjs-docs-gitbook
More Gitbooks : https://www.gitbook.com/@imfly
npm install npm link npm test - Convert articals between Simplified and Traditional Chinese.
- Generate eBooks(html, pdf, etc) by extending
gitbook;
We love pull requests! You can fork it and commit a pr
The MIT License



