diff options
author | Samy Pessé <samypesse@gmail.com> | 2017-01-06 22:14:38 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2017-01-06 22:14:38 +0100 |
commit | 9440cdee28286c077adec26d5cf2bb679486575e (patch) | |
tree | a3bc87460b4399aaecf1e7fd6ec197e8901a8a18 /docs/internals/README.md | |
parent | cc7b2b2181ce35acdd080edc9adbf8cc6b3f93e4 (diff) | |
download | gitbook-origin/test-utils.zip gitbook-origin/test-utils.tar.gz gitbook-origin/test-utils.tar.bz2 |
Improve documentationorigin/test-utils
Diffstat (limited to 'docs/internals/README.md')
-rw-r--r-- | docs/internals/README.md | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/internals/README.md b/docs/internals/README.md new file mode 100644 index 0000000..7ee13c3 --- /dev/null +++ b/docs/internals/README.md @@ -0,0 +1,33 @@ +# Using GitBook programmatically + +GitBook is mainly designed to work as a command line utility, but it can also be integrated into javascript application (Node.js or browser). + +Its API can be used for parsing a book, modifying the structure of a book, or generating outputs. + +### Installation + +``` +$ npm install gitbook +``` + +### Design + +The GitBook Core API is built around **promises** and **immutable** models. + +### Example + +```js +const GitBook = require('gitbook'); + +// Create a filesystem interface +const fs = GitBook.createNodeFS(__dirname + '/mybook'); + +// Create a book instance +const book = GitBook.Book.createForFS(fs); + +// Parse it +GitBook.Parse.parseBook(book) +.then(newBook => { + console.log('Done!'); +}) +``` |