Skip to content

Commit 0c6dd27

Browse files
committed
Added generic documentation
1 parent f47de65 commit 0c6dd27

34 files changed

+1570
-0
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

api-tool/readme.md

Whitespace-only changes.

docs/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# GitBook Toolchain Documentation
2+
3+
This document aims to be a comprehensive guide to the GitBook command line tool, version **3.2.3**. This is the same toolchain used by the legacy GitBook platform, living at legacy.gitbook.com. Help for using the platform can be found at [help.legacy.gitbook.com](https://help.legacy.gitbook.com). If you are looking for the new GitBook service, head to [gitbook.com](https://www.gitbook.com).
4+
5+
### What is `gitbook`?
6+
7+
`gitbook` is a command line tool (and Node.js library) for building beautiful books using GitHub/Git and Markdown (or AsciiDoc). This documentation has been generated using `gitbook.
8+
9+
`gitbook` can output your content as a website ([customizable](themes/README.md) and [extensibles](plugins/README.md)) or as an ebook (PDF, ePub or Mobi).
10+
11+
[legacy.gitbook.com](https://legacy.gitbook.com) is the online platform to create and host books built using the GitBook format. It offers hosting, collaboration features and an [easy-to-use editor](https://legacy.gitbook.com/editor).
12+
13+
### Help and Support
14+
15+
If you have problems with the toolchain, you can search for or open a discussion on [GitHub](https://github.com/GitbookIO/gitbook).
16+
17+
Check out the [GitBook Community Slack Channel](https://slack.gitbook.com) for help, and stay updated by following [@GitBookIO](https://twitter.com/GitBookIO) on Twitter or [GitBook](https://www.facebook.com/gitbookcom) on Facebook.
18+
19+
### FAQ
20+
21+
Some questions are frequently asked. If you have a problem you should [check this out](faq.md) first.
22+
23+
### Contribute to this documentation
24+
25+
You can contribute to improve this documentation on [GitHub](https://github.com/GitbookIO/gitbook) by signaling issues or proposing changes.

docs/SUMMARY.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Summary
2+
3+
### Getting Started
4+
5+
* [About this documentation](README.md)
6+
* [Installation and Setup](setup.md)
7+
8+
### Your Content
9+
10+
* [Directory structure](structure.md)
11+
* [Pages and Summary](pages.md)
12+
* [Configuration](config.md)
13+
* [Glossary](lexicon.md)
14+
* [Multi-Lingual](languages.md)
15+
* [Markdown](syntax/markdown.md)
16+
* [Headings](syntax/markdown.md#headings)
17+
* [Paragraphs](syntax/markdown.md#paragraphs)
18+
* [Lists](syntax/markdown.md#lists)
19+
* [Links](syntax/markdown.md#links)
20+
* [Images](syntax/markdown.md#images)
21+
* [Blockquotes](syntax/markdown.md#blockquotes)
22+
* [Tables](syntax/markdown.md#tables)
23+
* [Code](syntax/markdown.md#code)
24+
* [HTML](syntax/markdown.md#html)
25+
* [Footnotes](syntax/markdown.md#footnotes)
26+
* [AsciiDoc](syntax/asciidoc.md)
27+
* [eBook and PDF](ebook.md)
28+
29+
### Customization
30+
31+
* [Templating](templating/README.md)
32+
* [Content References](templating/conrefs.md)
33+
* [Variables](templating/variables.md)
34+
* [Builtin](templating/builtin.md)
35+
* [Plugins](plugins/README.md)
36+
* [Create a plugin](plugins/create.md)
37+
* [Hooks](plugins/hooks.md)
38+
* [Blocks](plugins/blocks.md)
39+
* [Filters](plugins/filters.md)
40+
* [API & Context](plugins/api.md)
41+
* [Test your plugin](plugins/testing.md)
42+
* [Theming](themes/README.md)
43+
44+
--
45+
46+
* [FAQ](faq.md)
47+
* [Examples](examples.md)
48+
* [Release notes](https://github.com/GitbookIO/gitbook/blob/master/CHANGES.md)
49+
50+

docs/_layouts/website/page.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{% extends template.self %}
2+
3+
{% block header_nav %}
4+
<a href="https://github.com/GitbookIO/gitbook/blob/master/docs/{{ file.path }}" target="_blank" class="btn btn-link pull-right hidden-xs">
5+
<i class="octicon octicon-mark-github"></i> Edit on GitHub
6+
</a>
7+
<a href="{{ "faq.md"|resolveFile }}" class="btn btn-link pull-right hidden-xs">
8+
F.A.Q
9+
</a>
10+
<a href="https://github.com/GitbookIO/gitbook/blob/master/CHANGES.md" target="_blank" class="btn btn-link pull-right hidden-xs">
11+
{{ book.version }}
12+
</a>
13+
{% endblock %}
14+
15+
{% block page %}
16+
{{ super() }}
17+
<hr>
18+
<div class="btn-group btn-group-justified">
19+
{% if page.previous and page.previous.path %}
20+
<a class="btn" href="{{ page.previous.path|resolveFile }}"><b>Previous:</b> {{ page.previous.title }}</a>
21+
{% endif %}
22+
{% if page.next and page.next.path %}
23+
<a class="btn" href="{{ page.next.path|resolveFile }}"><b>Next:</b> {{ page.next.title }}</a>
24+
{% endif %}
25+
</div>
26+
{% endblock %}

docs/config.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Configuration
2+
3+
GitBook allows you to customize your book using a flexible configuration. These options are specified in a `book.json` file. For authors unfamiliar with the JSON syntax, you can validate the syntax using tools such as [JSONlint](http://jsonlint.com).
4+
5+
### General Settings
6+
7+
| Variable | Description |
8+
| -------- | ----------- |
9+
| `root` | Path to the root folder containing all the book's files, except `book.json`|
10+
| `structure` | To specify paths for Readme, Summary, Glossary etc. See [Structure paragraph](#structure). |
11+
| `title` | Title of your book, default value is extracted from the README. On legacy.gitbook.com this field is pre-filled. |
12+
| `description` | Description of your book, default value is extracted from the README. On legacy.gitbook.com this field is pre-filled. |
13+
| `author` | Name of the author. On legacy.gitbook.com this field is pre-filled. |
14+
| `isbn` | ISBN of the book |
15+
| `language` | [ISO code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) of the book's language, default value is `en` |
16+
| `direction` | Text's direction. Can be `rtl` or `ltr`, the default value depends on the value of `language` |
17+
| `gitbook` | Version of GitBook that should be used. Uses the [SemVer](http://semver.org) specification and accepts conditions like `">= 3.0.0"` |
18+
19+
### Plugins
20+
21+
Plugins and their configurations are specified in the `book.json`. See [the plugins section](plugins/README.md) for more details.
22+
23+
Since version 3.0.0, GitBook can use themes. See [the theming section](themes/README.md) for more details.
24+
25+
| Variable | Description |
26+
| -------- | ----------- |
27+
| `plugins` | List of plugins to load |
28+
| `pluginsConfig` |Configuration for plugins |
29+
30+
### Structure
31+
32+
In addition to the `root` variable, you can tell Gitbook the name of the files for Readme, Summary, Glossary, Languages (instead of using the default names such as `README.md`).
33+
These files must be at the root of your book (or the root of every language book). Paths such as `dir/MY_README.md` are not accepted.
34+
35+
| Variable | Description |
36+
| -------- | ----------- |
37+
| `structure.readme` | Readme file name (defaults to `README.md`) |
38+
| `structure.summary` | Summary file name (defaults to `SUMMARY.md`) |
39+
| `structure.glossary` | Glossary file name (defaults to `GLOSSARY.md`) |
40+
| `structure.languages` | Languages file name (defaults to `LANGS.md`) |
41+
42+
### PDF Options
43+
44+
PDF Output can be customized using a set of options in the `book.json`:
45+
46+
| Variable | Description |
47+
| -------- | ----------- |
48+
| `pdf.pageNumbers` | Add page numbers to the bottom of every page (default is `true`) |
49+
| `pdf.fontSize` | Base font size (default is `12`) |
50+
| `pdf.fontFamily` | Base font family (default is `Arial`) |
51+
| `pdf.paperSize` | Paper size, options are `'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'legal', 'letter'` (default is `a4`) |
52+
| `pdf.margin.top` | Top margin (default is `56`) |
53+
| `pdf.margin.bottom` | Bottom margin (default is `56`) |
54+
| `pdf.margin.right` | Right margin (default is `62`) |
55+
| `pdf.margin.left` | Left margin (default is `62`) |

docs/ebook.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Generating eBooks and PDFs
2+
3+
GitBook can generates a website, but can also output content as ebook (ePub, Mobi, PDF).
4+
5+
```
6+
# Generate a PDF file
7+
$ gitbook pdf ./ ./mybook.pdf
8+
9+
# Generate an ePub file
10+
$ gitbook epub ./ ./mybook.epub
11+
12+
# Generate a Mobi file
13+
$ gitbook mobi ./ ./mybook.mobi
14+
```
15+
16+
### Installing ebook-convert
17+
18+
`ebook-convert` is required to generate ebooks (epub, mobi, pdf).
19+
20+
##### OS X
21+
22+
Download the [Calibre application](https://calibre-ebook.com/download). After moving the `calibre.app` to your Applications folder create a symbolic link to the ebook-convert tool:
23+
24+
```
25+
$ sudo ln -s ~/Applications/calibre.app/Contents/MacOS/ebook-convert /usr/bin
26+
```
27+
28+
You can replace `/usr/bin` with any directory that is in your $PATH.
29+
30+
### Cover
31+
32+
Covers are used for all the ebook formats. You can either provide one yourself, or generate one using the [autocover plugin](https://plugins.gitbook.com/plugin/autocover).
33+
34+
To provide a cover, place a **`cover.jpg`** file at the root directory of your book. Adding a **`cover_small.jpg`** will specify a smaller version of the cover. The cover should be a **JPEG** file.
35+
36+
A good cover should respect the following guidelines:
37+
38+
* Size of 1800x2360 pixels for `cover.jpg`, 200x262 for `cover_small.jpg`
39+
* No border
40+
* Clearly visible book title
41+
* Any important text should be visible in the small version

docs/examples.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
description: Real world examples of content published using GitBook.
3+
---
4+
5+
# Examples
6+
7+
More than 50,000 books have been published on [legacy.gitbook.com](https://legacy.gitbook.com/explore).
8+
9+
### Books
10+
11+
- [Front-end Handbook](https://legacy.gitbook.com/book/frontendmasters/front-end-handbook/details) by [Cody Lindley](http://codylindley.com)
12+
- [How to make an Operating System](https://legacy.gitbook.com/book/samypesse/how-to-create-an-operating-system/details) by [@SamyPesse](https://github.com/SamyPesse)
13+
- [Building Web Apps with Go](https://legacy.gitbook.com/book/codegangsta/building-web-apps-with-go/details) by [@codegangsta](https://github.com/codegangsta)
14+
- [Django Girls Tutorial](http://tutorial.djangogirls.org/en/index.html) by [Django Girls](https://djangogirls.org)
15+
- [Linux Inside](https://legacy.gitbook.com/book/0xax/linux-insides/details) by [0xAX](https://twitter.com/0xAX)
16+
- [Learn Javascript](https://legacy.gitbook.com/book/gitbookio/javascript/details) by [GitBook](https://twitter.com/GitbookIO)
17+
18+
### Research Papers
19+
20+
- [TowCenter Collection](https://legacy.gitbook.com/@towcenter) by [Columbia Journalism School](http://www.journalism.columbia.edu/)
21+
- [Block Relaxation Algorithms in Statistics](https://legacy.gitbook.com/@jandeleeuw) by Jan de Leeuw
22+
23+
### Documentation
24+
25+
- [DuckDuckHack Documentation](http://docs.duckduckhack.com) by [DuckDuckGo](https://duckduckgo.com/about)
26+
- [Loomio Handbook](http://loomio.coop/) by [Loomio](https://www.loomio.org/)
27+
- [Enspiral Handbook](http://handbook.enspiral.com/) by [Enspiral](http://enspiral.com/)
28+
- This documentation
29+

docs/faq.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# GitBook FAQ
2+
3+
This page gathers common questions and answers concerning the GitBook format and toolchain.
4+
5+
Questions about the legacy platform at legacy.gitbook.com and the Editor are gather into the [help.legacy.gitbook.com's FAQ](http://help.legacy.gitbook.com/faq.html).
6+
7+
#### How can I host/publish my book?
8+
9+
Books can easily be published and hosted on [legacy.gitbook.com](https://legacy.gitbook.com). But GitBook output can be hosted on any static file hosting solution.
10+
11+
#### What can I use to edit my content?
12+
13+
Any text editor should work! But we advise using the [GitBook Editor](https://legacy.gitbook.com/editor). [legacy.gitbook.com](https://legacy.gitbook.com) also provides a web version of this editor.
14+
15+
---
16+
17+
#### Does GitBook supports RTL/bi-directional text ?
18+
19+
The GitBook format supports right to left, and bi-directional writing. To enable it, you either need to specify a language (ex: `ar`), or force GitBook to use RTL in your `book.json`:
20+
21+
``` json
22+
{
23+
"language": "ar",
24+
"direction": "rtl"
25+
}
26+
```
27+
28+
With version 3.0 of GitBook, it's automatically detected according to the content.
29+
_Note that, while the output book will indeed respect RTL, the Editor doesn't support RTL writing yet_.
30+
31+
#### Should I use an `.html` or `.md` extensions in my links?
32+
33+
You should always use paths and the `.md` extensions when linking to your files, GitBook will automatically replace these paths by the appropriate link when the pointing file is referenced in the Table of Contents.
34+
35+
#### Can I create a GitBook in a sub-directory of my repository?
36+
37+
Yes, GitBooks can be created in [sub-directories](structure.md#subdirectory). legacy.gitbook.com and the CLI also looks by default in a serie of [folders](structure.md).
38+
39+
#### Does GitBook supports RTL languages?
40+
41+
Yes, GitBook automatically detect the direction in your pages (`rtl` or `ltr`) and adjust the layout accordingly. The direction can also be specified globally in the [book.json](config.md).
42+
43+
---
44+
45+
#### Does GitBook support Math equations?
46+
47+
GitBook supports math equations and TeX thanks to plugins. There are currently 2 official plugins to display math: [mathjax](https://plugins.gitbook.com/plugin/mathjax) and [katex](https://plugins.gitbook.com/plugin/katex).
48+
49+
#### Can I customize/theme the output?
50+
51+
Yes, both the website and ebook outputs can be customized using [themes](themes/README.md).
52+
53+
#### Can I add interactive content (videos, etc)?
54+
55+
GitBook is very [extensible](plugins/README.md). You can use [existing plugins](https://plugins.gitbook.com) or create your own!

docs/languages.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Multi-Languages
2+
3+
GitBook supports building books written in multiple languages. Each language should be a sub-directory following the normal GitBook format, and a file named `LANGS.md` should be present at the root of the repository with the following format:
4+
5+
```markdown
6+
# Languages
7+
8+
* [English](en/)
9+
* [French](fr/)
10+
* [Español](es/)
11+
```
12+
13+
### Configuration for each language
14+
15+
When a language book (ex: `en`) has a `book.json`, its configuration will extend the main configuration.
16+
17+
The only exception is plugins, plugins are specified globally, and language specific plugins cannot be specified.

docs/lexicon.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Glossary
2+
3+
Allows you to specify terms and their respective definitions to be displayed as annotations. Based on those terms, GitBook will automatically build an index and highlight those terms in pages.
4+
5+
The `GLOSSARY.md` format is a list of `h2` headings, along with a description paragraph:
6+
7+
```markdown
8+
## Term
9+
Definition for this term
10+
11+
## Another term
12+
With it's definition, this can contain bold text
13+
and all other kinds of inline markup ...
14+
```

0 commit comments

Comments
 (0)