diff options
-rw-r--r-- | docs/README.md | 4 | ||||
-rw-r--r-- | docs/asciidoc.md | 15 | ||||
-rw-r--r-- | docs/config.md | 36 | ||||
-rw-r--r-- | docs/examples.md | 4 | ||||
-rw-r--r-- | docs/faq.md | 6 | ||||
-rw-r--r-- | docs/languages.md | 2 | ||||
-rw-r--r-- | docs/lexicon.md | 7 | ||||
-rw-r--r-- | docs/pages.md | 44 | ||||
-rw-r--r-- | docs/plugins/README.md | 2 | ||||
-rw-r--r-- | docs/setup.md | 10 | ||||
-rw-r--r-- | docs/structure.md | 8 | ||||
-rw-r--r-- | docs/templating/README.md | 19 | ||||
-rw-r--r-- | docs/templating/conrefs.md | 8 | ||||
-rw-r--r-- | docs/templating/variables.md | 8 | ||||
-rw-r--r-- | docs/themes/README.md | 2 |
15 files changed, 110 insertions, 65 deletions
diff --git a/docs/README.md b/docs/README.md index 6febb43..12b0e6c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,7 +4,7 @@ GitBook is a command line tool (and Node.js library) for building beautiful books using GitHub/Git and Markdown (or AsciiDoc). Here is an example: [Learn Javascript](https://www.gitbook.com/book/GitBookIO/javascript). This documentation has been generated using GitBook. -GitBook can output your content as a website ([customizable](themes.md) and [extensibles](plugins.md)) or as an ebook (PDF, ePub or Mobi). +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). [GitBook.com](https://www.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://www.gitbook.com/editor). @@ -14,7 +14,7 @@ We're always happy to help out with your books or any other questions you might ### FAQ -There are questions that are asked quite often, [check this out before creating an issue](faq.md). +Some questions are frequently asked. If you have a problem you should [check this out](faq.md) first. ### Contribute to this documentation diff --git a/docs/asciidoc.md b/docs/asciidoc.md index c04098b..d51ebcc 100644 --- a/docs/asciidoc.md +++ b/docs/asciidoc.md @@ -8,11 +8,11 @@ Just like for markdown, GitBook is using some special files to extract structure ### README.adoc -This is the main entry of your book: the introduction. This file is **non optional**. +This is the main entry of your book: the introduction. This file is **required**. ### SUMMARY.adoc -This file defines the list of chapters and subchapters. Just like [for markdown](./pages.md), the `SUMMARY.adoc`'s format is simply a list of links, the name of the link is used as the chapter's name, and the target is a path to that chapter's file. +This file defines the list of chapters and subchapters. Just like in Markdown, the `SUMMARY.adoc`'s format is simply a list of links, the name of the link is used as the chapter's name, and the target is a path to that chapter's file. Subchapters are defined simply by adding a nested list to a parent chapter. @@ -51,10 +51,15 @@ This file is used to define terms. [See the glossary section](./lexicon.md). = Glossary == Magic -Sufficiently advanced technology, beyond the understanding of the observer producing a sense of wonder. + +Sufficiently advanced technology, beyond the understanding of the +observer producing a sense of wonder. == PHP -A popular web programming language, used by many large websites such as Facebook. Rasmus Lerdorf originally created PHP in 1994 to power his personal homepage (PHP originally stood for "Personal Home Page" but now stands for "PHP: Hypertext Preprocessor"). -``` + +A popular web programming language, used by many large websites such +as Facebook. Rasmus Lerdorf originally created PHP in 1994 to power +his personal homepage (PHP originally stood for "Personal Home Page" +but now stands for "PHP: Hypertext Preprocessor"). ``` diff --git a/docs/config.md b/docs/config.md index de3816b..0b1e188 100644 --- a/docs/config.md +++ b/docs/config.md @@ -1,21 +1,36 @@ # Configuration -GitBook allows you to customize your book using a flexible configuration. These options are specified in a `book.json` file. For authors, not used to write JSON, you can validate the syntax using [jsonlint](http://jsonlint.com). +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). -### Configuration Settings +### General Settings | Variable | Description | | -------- | ----------- | -| `root` | Path to the root folder containing the content | +| `root` | Path to the root folder containing all the book's files, except `book.json`| | `title` | Title of your book, default value is extracted from the README. On GitBook.com this field is pre-filled. | | `description` | Description of your book, default value is extracted from the README. On GitBook.com this field is pre-filled. | | `author` | Name of the author. On GitBook.com this field is pre-filled. | | `isbn` | ISBN of the book | -| `language` | ISO code of the book's language, default value is `en` | -| `direction` | `rtl` or `ltr`, default value depends on the value of `language` | -| `gitbook` | [SemVer](http://semver.org) condition to validate which GitBook version should be used | -| `plugins` | List of plugins to load, See [the plugins section](plugins/README.md) for more details | -| `pluginsConfig` |Configuration for plugins, See [the plugins section](plugins/README.md) for more details | +| `language` | [ISO code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) of the book's language, default value is `en` | +| `direction` | Text's direction. Can be `rtl` or `ltr`, the default value depends on the value of `language` | +| `gitbook` | Version of GitBook that should be used. Uses the [SemVer](http://semver.org) specification and accepts conditions like `">= 3.0.0"` | + +### Plugins + +Plugins and their configurations are specified in the `book.json`. See [the plugins section](plugins/README.md) for more details. + +| Variable | Description | +| -------- | ----------- | +| `plugins` | List of plugins to load | +| `pluginsConfig` |Configuration for plugins | + +### Theme + +Since version 3.0.0, GitBook can use themes. See [the theming section](themes/README.md) for more details. + +| Variable | Description | +| -------- | ----------- | +| `theme` | The theme to use for the book | ### PDF Options @@ -31,8 +46,3 @@ PDF Output can be customized using a set of options in the `book.json`: | `pdf.margin.bottom` | Bottom margin (default is `56`) | | `pdf.margin.right` | Right margin (default is `62`) | | `pdf.margin.left` | Left margin (default is `62`) | - -### Plugins - -Plugins and their configurations are specified in the `book.json`. See [the plugins section](plugins/README.md) for more details. - diff --git a/docs/examples.md b/docs/examples.md index 2dbaea8..fc1cfe6 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -17,11 +17,11 @@ More than 50,000 books have benn published on [GitBook.com](https://www.gitbook. ### Research Papers -- [TowCenter Collection](https://www.gitbook.com/@towcenter) by [Columbia Journalism School]() +- [TowCenter Collection](https://www.gitbook.com/@towcenter) by [Columbia Journalism School](http://www.journalism.columbia.edu/) - [Block Relaxation Algorithms in Statistics](https://www.gitbook.com/@jandeleeuw) by Jan de Leeuw ### Documentation -- [DuckDuckHack Documentation](http://docs.duckduckhack.com) by DuckDuckGo +- [DuckDuckHack Documentation](http://docs.duckduckhack.com) by [DuckDuckGo](https://duckduckgo.com/about) - This documentation diff --git a/docs/faq.md b/docs/faq.md index 42de8fe..57fdf3b 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -12,7 +12,7 @@ Any text editor should work! But we advise using the [GitBook Editor](https://ww #### Should I use an `.html` or `.md` extensions in my links? -You should always use `.md` extensions for your relative links, GitBook will automatically replace these links by the right value when the pointing file is referenced in the Table of Contents. +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. #### Can I create a GitBook in a sub-directory of my repository? @@ -26,8 +26,8 @@ GitBook supports math equations and TeX thanks to plugins. There are currently 2 #### Can I customize/theme the output? -Yes, both the website and ebook outputs can be customized using [themes](themes.md). +Yes, both the website and ebook outputs can be customized using [themes](themes/README.md). #### Can I add interactive content (videos, etc)? -GitBook is very [extensible](plugins.md). You can use [existing plugins](https://plugins.gitbook.com) or create your own! +GitBook is very [extensible](plugins/README.md). You can use [existing plugins](https://plugins.gitbook.com) or create your own! diff --git a/docs/languages.md b/docs/languages.md index 0cb5801..6afbd4e 100644 --- a/docs/languages.md +++ b/docs/languages.md @@ -14,4 +14,4 @@ GitBook supports building books written in multiple languages. Each language sho When a language book (ex: `en`) has a `book.json`, its configuration will extend the main configuration. -The only exception is plugins, plugins are specify globally relative to the book, and language specific plugins can not be specified. +The only exception is plugins, plugins are specified globally, and language specific plugins cannot be specified. diff --git a/docs/lexicon.md b/docs/lexicon.md index 5d356b4..5740139 100644 --- a/docs/lexicon.md +++ b/docs/lexicon.md @@ -1,6 +1,6 @@ # Glossary -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. +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. The `GLOSSARY.md` format is very simple : @@ -9,5 +9,6 @@ The `GLOSSARY.md` format is very simple : Definition for this term # Another term -With it's definition, this can contain bold text and all other kinds of inline markup ... -```
\ No newline at end of file +With it's definition, this can contain bold text +and all other kinds of inline markup ... +``` diff --git a/docs/pages.md b/docs/pages.md index 8ffa054..46799b3 100644 --- a/docs/pages.md +++ b/docs/pages.md @@ -1,12 +1,12 @@ # Pages and Summary -GitBook uses a `SUMMARY.md` file to define the structure of chapters and subchapters of the book. The `SUMMARY.md` file is used to generate the book's table of contents. - ### Summary -The `SUMMARY.md`'s format is simply a list of links, the title of the link is used as the chapter's title, and the target is a path to that chapter's file. +GitBook uses a `SUMMARY.md` file to define the structure of chapters and subchapters of the book. The `SUMMARY.md` file is used to generate the book's table of contents. -Subchapters are defined simply by adding a nested list to a parent chapter. +The format of `SUMMARY.md` is just a list of links. The link's title is used as the chapter's title, and the link's target is a path to that chapter's file. + +Adding a nested list to a parent chapter will create subchapters. ##### Simple example @@ -21,23 +21,50 @@ Subchapters are defined simply by adding a nested list to a parent chapter. * [Better tools for authors](part2/better_tools.md) ``` +Each chapter has a dedicated page (`part#/README.md`) and is split into subchapters. + ##### Example with subchapters split into parts ```markdown # Summary -### Part 1 +### Part I * [Writing is nice](part1/writing.md) * [GitBook is nice](part1/gitbook.md) -### Part 2 +### Part II * [We love feedback](part2/feedback_please.md) * [Better tools for authors](part2/better_tools.md) ``` -### Front Matter +Here, parts are just groups of chapters and do not have dedicated pages, but will show in the navigation for example. + +### Pages + +#### Markdown syntax + +Most of the files for GitBook use the Markdown syntax by default. GitBook infers your pages's structure from it. The syntax used is similar to the [GitHub Flavored Markdown syntax](https://guides.github.com/features/mastering-markdown/). One can also opt for the [AsciiDoc syntax](asciidoc.md). + +##### Example of a chapter file + +``` markdown +# Title of the chapter + +This is a great introduction. + +## Section 1 + +Markdown will dictates _most_ of your **book's structure** + +## Section 2 + +... + +``` + +#### Front Matter Pages can contain an optional front matter. It can be used to define the page's description. The front matter must be the first thing in the file and must take the form of valid YAML set between triple-dashed lines. Here is a basic example: @@ -47,4 +74,7 @@ description: This is a short description of my page --- # The content of my page +... ``` + +The front matter can define variables of your own, they will be added to the [book variable](templating/variables.md) so you can use them in your templating. diff --git a/docs/plugins/README.md b/docs/plugins/README.md index eeed839..4df62b8 100644 --- a/docs/plugins/README.md +++ b/docs/plugins/README.md @@ -25,4 +25,4 @@ Plugins are automatically installed on [GitBook.com](https://www.gitbook.com). L ### Configuring plugins -PLugins specific configurations are stored in `pluginsConfig`. You have to refer to the documentation of the plugin itself for details about the available options. +Plugins specific configurations are stored in `pluginsConfig`. You have to refer to the documentation of the plugin itself for details about the available options. diff --git a/docs/setup.md b/docs/setup.md index 764dedd..878fe57 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -4,7 +4,7 @@ Getting GitBook installed and ready-to-go should only take a few minutes. ### GitBook.com -[GitBook.com](https://www.gitbook.com) is an easy to use solution to write, publish and host books. It's best and easier solution for publishing your content and collaborate on it. +[GitBook.com](https://www.gitbook.com) is an easy to use solution to write, publish and host books. It is the easiest solution for publishing your content and collaborating on it. It integrates well with the [GitBook Editor](https://www.gitbook.com/editor). @@ -12,7 +12,7 @@ It integrates well with the [GitBook Editor](https://www.gitbook.com/editor). ##### Requirements -Installing GitBook is easy and straight-forward, but there are a few requirements you’ll need to make sure your system has before you start. +Installing GitBook is easy and straightforward. Your system just needs to meet these two requirements: * NodeJS (v4.0.0 and above are adviced) * Windows, Linux, Unix, or Mac OS X @@ -25,7 +25,7 @@ The best way to install GitBook is via **NPM**. At the terminal prompt, simply r $ npm install gitbook-cli -g ``` -`gitbook-cli` is an utility to install and use multiple versions of GitBook on the same system. It will automatically install the required version to build a book. +`gitbook-cli` is an utility to install and use multiple versions of GitBook on the same system. It will automatically install the required version of GitBook to build a book. ##### Create a book @@ -43,7 +43,7 @@ Preview and serve your book using: $ gitbook serve ``` -or build the static website using: +Or build the static website using: ``` $ gitbook build @@ -51,7 +51,7 @@ $ gitbook build ##### Install pre-releases -`gitbook-cli` makes it easy to install and test other versions of GitBook with your book: +`gitbook-cli` makes it easy to download and install other versions of GitBook to test with your book: ``` $ gitbook fetch beta diff --git a/docs/structure.md b/docs/structure.md index a811bd9..907f3e0 100644 --- a/docs/structure.md +++ b/docs/structure.md @@ -1,6 +1,6 @@ # Directory structure -GitBook uses a very simple and obvious directory structure: +GitBook uses a simple directory structure: ``` . @@ -26,7 +26,7 @@ An overview of what each of these does: ### Static files and Images -A static file is a file that is not listed in the `SUMMARY.md`. All static files, not [ignored](#ignore), are copied to the output. +A static file is a file that is not listed in the `SUMMARY.md`. All static files, unless [ignored](#ignore), are copied to the output. ### Ignoring files & folders {#ignore} @@ -43,9 +43,9 @@ test.md bin/* ``` -### Project documentation / Sub-directory {#subdirectory} +### Project integration with subdirectory {#subdirectory} -For software project, it sometimes better to use a diretcory (like `docs/`) to store the project's documentation. You can use the [`root` option](config.md) to indicate to GitBook in which folder the book is stored: +For software projects, you can use a subdirectory (like `docs/`) to store the book for the project's documentation. You can configure the [`root` option](config.md) to indicate the folder where GitBook can find the book's files: ``` . diff --git a/docs/templating/README.md b/docs/templating/README.md index 38df38e..963f921 100644 --- a/docs/templating/README.md +++ b/docs/templating/README.md @@ -1,18 +1,18 @@ # Templating -GitBook uses the Nunjucks templating language to process pages and theme's templates. +GitBook uses the [Nunjucks templating language](https://mozilla.github.io/nunjucks/) to process pages and theme's templates. -The Nunjucks syntax is very similar to **Jinja2** or **Liquid**. +The Nunjucks syntax is very similar to **Jinja2** or **Liquid**. Its syntax uses surrounding braces `{ }` to mark content that needs to be processed. ### Variables -A variable looks up a value from the template context. If you wanted to simply display a variable, you would do: +A variable looks up a value from the template context. If you wanted to simply display a variable, you would use the `{{ variable }}` syntax. For example : ```twig -{{ username }} +My name is {{ name }}, nice to meet you ``` -This looks up username from the context and displays it. Variable names can have dots in them which lookup properties, just like javascript. You can also use the square bracket syntax. +This looks up username from the context and displays it. Variable names can have dots in them which lookup properties, just like JavaScript. You can also use the square bracket syntax. ```twig {{ foo.bar }} @@ -21,7 +21,7 @@ This looks up username from the context and displays it. Variable names can have If a value is undefined, nothing is displayed. The following all output nothing if foo is undefined: `{{ foo }}`, `{{ foo.bar }}`, `{{ foo.bar.baz }}`. -GitBook provides a set of [context variables](variables.md). +GitBook provides a set of [predefined variables](variables.md) from the context. ### Filters @@ -39,7 +39,7 @@ The third example shows how you can chain filters. It would display "Bar", by fi ##### if -`if` tests a condition and lets you selectively display content. It behaves exactly as javascript's if behaves. +`if` tests a condition and lets you selectively display content. It behaves exactly as JavaScript's `if` behaves. ```twig {% if variable %} @@ -49,7 +49,7 @@ The third example shows how you can chain filters. It would display "Bar", by fi If variable is defined and evaluates to true, "It is true" will be displayed. Otherwise, nothing will be. -You can specify alternate conditions with elif and else: +You can specify alternate conditions with `elif` and `else`: ```twig {% if hungry %} @@ -86,5 +86,4 @@ Current version is {{ softwareVersion }}. ##### include and block -Inclusion and inheritance is detailled in the [ConRefs](conrefs.md) section. - +Inclusion and inheritance is detailled in the [Content References](conrefs.md) section. diff --git a/docs/templating/conrefs.md b/docs/templating/conrefs.md index 7844e9c..252fec9 100644 --- a/docs/templating/conrefs.md +++ b/docs/templating/conrefs.md @@ -1,10 +1,10 @@ # Content References -Content referencing (conref) is a convenient mechanism for reuse of content from other files or books. +Content referencing (conref) is a convenient mechanism to reuse content from other files or books. ### Importing local files -Importing an other file's content is really easy using the `include` tag: +Importing an other file's content is easy using the `include` tag: ``` {% include "./test.md" %} @@ -21,7 +21,7 @@ GitBook can also resolve the include path by using git: The format of git url is: ``` -git+https://user@hostname/project/blah.git/file#commit-ish +git+https://user@hostname/owner/project.git/file#commit-ish ``` The real git url part should finish with `.git`, the filename to import is extracted after the `.git` till the fragment of the url. @@ -42,7 +42,7 @@ Template inheritance is a way to make it easy to reuse templates. When writing a {% endblock %} ``` -In the file `mypage.md`, you should specify the blocks that can be extent: +In the file `mypage.md`, you should specify the blocks that can be extended: ``` {% block pageContent %} diff --git a/docs/templating/variables.md b/docs/templating/variables.md index 3dbd6f7..bca5880 100644 --- a/docs/templating/variables.md +++ b/docs/templating/variables.md @@ -6,7 +6,7 @@ The following is a reference of the available data during book's parsing and the | Variable | Description | | -------- | ----------- | -| `book` | Bookwide information + configuration settings from `book.json`. See below for details. | +| `book` | Book-wide information + configuration settings from `book.json`. See below for details. | | `gitbook` | GitBook specific information | | `page` | Current page specific information | | `file` | File associated with the current page specific information | @@ -25,7 +25,7 @@ The following is a reference of the available data during book's parsing and the | Variable | Description | | -------- | ----------- | -| `gitbook.time` | The current time (when you run the `gitbook` command). | +| `gitbook.time` | The current time (when you run the `gitbook` command) . | | `gitbook.version` | Version of GitBook used to generate the book | ### File Variables @@ -33,7 +33,7 @@ The following is a reference of the available data during book's parsing and the | Variable | Description | | -------- | ----------- | | `file.path` | The path to the raw page | -| `file.mtime` | Modified Time, Time when file data last modified | +| `file.mtime` | Modified Time. Last time the file was modified | | `file.type` | The name of the parser used to compile this file (ex: `markdown`, `asciidoc`, etc) | #### Page Variables @@ -51,7 +51,7 @@ The following is a reference of the available data during book's parsing and the | -------- | ----------- | | `summary.parts` | List of sections in the Table of Contents | -Thw whole table of contents (`SUMMARY.md`) can be accessed: +The whole table of contents (`SUMMARY.md`) can be accessed: `summary.parts[0].articles[0].title` will return the title of the first article. diff --git a/docs/themes/README.md b/docs/themes/README.md index 48c19db..8a36109 100644 --- a/docs/themes/README.md +++ b/docs/themes/README.md @@ -23,4 +23,4 @@ Authors can extend the templates of a theme directly from the book source (witho ### Publish a theme -Themes are published as plugins ([see related docs](plugins.md)) with a `theme-` prefix. For example the theme `awesome` will be loaded from `theme-awesome` plugin, and then from `gitbook-plugin-theme-awesome` NPM package. +Themes are published as plugins ([see related docs](../plugins/README.md)) with a `theme-` prefix. For example the theme `awesome` will be loaded from the `theme-awesome` plugin, and then from the `gitbook-plugin-theme-awesome` NPM package. |