https://github.com/pm5/gitbook-plugin-json
Gitbook plugin to generate ebook in JSON format.
https://github.com/pm5/gitbook-plugin-json
Last synced: 24 days ago
JSON representation
Gitbook plugin to generate ebook in JSON format.
- Host: GitHub
- URL: https://github.com/pm5/gitbook-plugin-json
- Owner: pm5
- Created: 2015-01-04T10:46:02.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-16T10:19:48.000Z (almost 9 years ago)
- Last Synced: 2024-10-18T07:48:59.974Z (7 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - pm5/gitbook-plugin-json - Gitbook plugin to generate ebook in JSON format. (others)
README
Gitbook JSON Plugin
===================
Gitbook plugin to generate ebook in JSON format.
Usage
-----Add the following entry in `book.json`:
```
{
"plugins": [
"json"
]
}
```Then install it with: ```$ gitbook install .```.
From now on `gitbook build` will also generate a file `output.json` in your project directory in a format similar to the following:
```
[
{
"title": "Introduction",
"heading": "h1",
"content": "\nlorem ipsum dolor sit amet consetetur sadipscing elitr sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
...",
"path": "README.md"
},
{
"title": "Chapter 1",
"heading": "h1",
"content": "\nlorem ipsum dolor sit amet consetetur sadipscing elitr sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
\n",
"children": [
{
"title": "Section 1",
"heading": "h2",
"content": "..."
},
{
"title": "Section 2",
"heading": "h2",
"content": "...",
"children": [
/* subsections */
]
}
],
"path": "1.md"
}
// ...
]
```Configuration
-------------You can set JSON output filename in `book.json`:
```
{
"plugins": [
"json"
],
"pluginsConfig": {
"json": {
"output": "_book/book.json"
}
}
}
```