mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-12 05:48:57 +00:00
Merge branch 'master' into dream
This commit is contained in:
+21
-10
@@ -1,19 +1,30 @@
|
||||
Thank you for giving us your feedback! We listed some guidelines to help you:
|
||||
<!--
|
||||
IMPORTANT NOTICE
|
||||
Only post things related to the gitbook CLI
|
||||
For GitBook.com, the Editor, or anything else
|
||||
please go to
|
||||
https://github.com/GitbookIO/feedback/issues
|
||||
|
||||
Please open separate issues for each bug report.
|
||||
-->
|
||||
|
||||
If possible, open separate issues for each bug report. Avoid grouping bugs that are unrelated.
|
||||
|
||||
### What is the current behavior?
|
||||
|
||||
If the current behavior is a bug, please provide the steps to reproduce. if possible, provide the GitBook version being used (`gitbook -V`) and the system infromations (OS and version).
|
||||
<!--
|
||||
- For bugs, provide the steps to reproduce
|
||||
- Provide the GitBook version being used (`gitbook -V`)
|
||||
- Provide system informations (OS and version)
|
||||
- Provide your username and the URL of the book
|
||||
-->
|
||||
|
||||
|
||||
|
||||
### What is the expected behavior?
|
||||
|
||||
How do you think, or how would you like it should behave.
|
||||
|
||||
#### For GitBook.com
|
||||
|
||||
Provide, if possible, your username and the URL of the concerned book.
|
||||
|
||||
----
|
||||
|
||||
The GitBook Team
|
||||
<!--
|
||||
Thank you for giving us your feedback!
|
||||
-- The GitBook Team
|
||||
-->
|
||||
|
||||
@@ -13,6 +13,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- *Plugin API*: hook `page` can no longer modify the content, only the page's attributes
|
||||
- *Plugin API*: plugins can no longer export resources, instead use the `_assets` folder
|
||||
|
||||
## 3.2.2
|
||||
- Fix catching parsing errors leading to possible missing pages in generated book
|
||||
- Rollback markdown parser to `kramed` until `markup-it` is stable enough
|
||||
|
||||
## 3.2.1
|
||||
- Fix bug on Firefox when navigating to an url containing an hash
|
||||
- Update nunjucks to fix JS error when page contains a lot of templating blocks
|
||||
|
||||
## 3.2.0
|
||||
- Switch markdown parser from `kramed` to `markup-it`
|
||||
- Fix support of `|` in tables
|
||||
|
||||
+2
-3
@@ -4,7 +4,7 @@ This document aims to be a comprehensive guide to GitBook. It contains the full
|
||||
|
||||
### What is GitBook?
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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).
|
||||
|
||||
@@ -18,9 +18,8 @@ Check out the [GitBook Community Slack Channel](https://slack.gitbook.com), Stay
|
||||
|
||||
### FAQ
|
||||
|
||||
Some questions are frequently asked. If you have a problem you should [check this out](faq.md) first.
|
||||
Some questions are frequently asked. If you have a problem you should [check this out](faq.md) first.
|
||||
|
||||
### Contribute to this documentation
|
||||
|
||||
You can contribute to improve this documentation on [GitHub](https://github.com/GitbookIO/gitbook) by signaling issues or proposing changes.
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* [Markdown](syntax/markdown.md)
|
||||
* [Headings](syntax/markdown.md#headings)
|
||||
* [Paragraphs](syntax/markdown.md#paragraphs)
|
||||
* [Emphasis](syntax/markdown.md#emphasis)
|
||||
* [Lists](syntax/markdown.md#lists)
|
||||
* [Links](syntax/markdown.md#links)
|
||||
* [Images](syntax/markdown.md#images)
|
||||
|
||||
@@ -17,6 +17,20 @@ $ gitbook mobi ./ ./mybook.mobi
|
||||
|
||||
`ebook-convert` is required to generate ebooks (epub, mobi, pdf).
|
||||
|
||||
##### GNU/Linux
|
||||
|
||||
Install the [Calibre application](https://calibre-ebook.com/download).
|
||||
|
||||
```
|
||||
$ sudo aptitude install calibre
|
||||
```
|
||||
|
||||
In some GNU/Linux distributions node is installed as nodejs, you need to manually create a symlink:
|
||||
|
||||
```
|
||||
$sudo ln -s /usr/bin/nodejs /usr/bin/node
|
||||
```
|
||||
|
||||
##### OS X
|
||||
|
||||
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:
|
||||
|
||||
+2
-1
@@ -23,5 +23,6 @@ More than 50,000 books have been published on [GitBook.com](https://www.gitbook.
|
||||
### Documentation
|
||||
|
||||
- [DuckDuckHack Documentation](http://docs.duckduckhack.com) by [DuckDuckGo](https://duckduckgo.com/about)
|
||||
- [Loomio Handbook](http://loomio.coop/) and [guide to using Loomio](https://loomio.gitbooks.io/manual/content/en/index.html) both by [Loomio](https://www.loomio.org/)
|
||||
- [Enspiral Handbook](http://handbook.enspiral.com/) by [Enspiral](http://enspiral.com/)
|
||||
- This documentation
|
||||
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ Any text editor should work! But we advise using the [GitBook Editor](https://ww
|
||||
|
||||
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`:
|
||||
|
||||
``` json
|
||||
```json
|
||||
{
|
||||
"language": "ar",
|
||||
"direction": "rtl"
|
||||
@@ -34,7 +34,7 @@ You should always use paths and the `.md` extensions when linking to your files,
|
||||
|
||||
#### Can I create a GitBook in a sub-directory of my repository?
|
||||
|
||||
Yes, GitBooks can be created in [sub-directories](structure.md#subdirectory). GitBook.com and the CLI also looks by default in a serie of [folders](structure.md).
|
||||
Yes, GitBooks can be created in [sub-directories](structure.md#subdirectory). GitBook.com and the CLI also looks by default in a series of [folders](structure.md).
|
||||
|
||||
#### Does GitBook supports RTL languages?
|
||||
|
||||
|
||||
+1
-2
@@ -40,7 +40,6 @@ Chapters in the Table of Contents can be pointing to specific part of a file usi
|
||||
* [Better tools for authors](part2/README.md#tools)
|
||||
```
|
||||
|
||||
|
||||
##### Parts
|
||||
|
||||
The Table of Contents can be divided into parts separated by headings or horizontal lines:
|
||||
@@ -73,7 +72,7 @@ Most of the files for GitBook use the Markdown syntax by default. GitBook infers
|
||||
|
||||
##### Example of a chapter file
|
||||
|
||||
``` markdown
|
||||
```markdown
|
||||
# Title of the chapter
|
||||
|
||||
This is a great introduction.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Plugins
|
||||
|
||||
Plugins are the best way to extend GitBook functionalities (ebook and website). There exist plugins to do a lot of things: bring math formulas display support, track visits using Google Analytic, etc.
|
||||
Plugins are the best way to extend GitBook functionalities (ebook and website). There exist plugins to do a lot of things: bring math formulas display support, track visits using Google Analytics, etc.
|
||||
|
||||
### How to find plugins?
|
||||
|
||||
|
||||
@@ -54,4 +54,4 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
```
|
||||
|
||||
@@ -71,7 +71,6 @@ In the `page` hook, `page.content` is the HTML generated from the markdown/ascii
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Asynchronous Operations
|
||||
|
||||
Hooks callbacks can be asynchronous and return promises.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
### Testing your plugin locally
|
||||
|
||||
Testing your plugin on your book before plushing it is possible using [npm link](https://docs.npmjs.com/cli/link).
|
||||
Testing your plugin on your book before publishing it is possible using [npm link](https://docs.npmjs.com/cli/link).
|
||||
|
||||
In the plugin's folder, run:
|
||||
|
||||
@@ -19,4 +19,3 @@ $ npm link gitbook-plugin-<plugin's name>
|
||||
### Unit testing on Travis
|
||||
|
||||
[gitbook-tester](https://github.com/todvora/gitbook-tester) makes it easy to write **Node.js/Mocha** unit tests for your plugins. Using [Travis.org](https://travis.org), tests can be run on each commits/tags.
|
||||
|
||||
|
||||
@@ -66,4 +66,3 @@ You can use the options `--log=debug` and `--debug` to get better error messages
|
||||
```
|
||||
$ gitbook build ./ --log=debug --debug
|
||||
```
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ 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 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.
|
||||
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.
|
||||
|
||||
@@ -60,6 +60,5 @@ observer producing a sense of wonder.
|
||||
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"). ```
|
||||
|
||||
|
||||
but now stands for "PHP: Hypertext Preprocessor").
|
||||
```
|
||||
|
||||
@@ -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 [predefined variables](variables.md) from the context.
|
||||
GitBook provides a set of [predefined variables](variables.md) from the context.
|
||||
|
||||
### Filters
|
||||
|
||||
@@ -92,7 +92,7 @@ Inclusion and inheritance is detailled in the [Content References](conrefs.md) s
|
||||
|
||||
If you want GitBook to ignore any of the special templating tags, you can use raw and anything inside of it will be output as plain text.
|
||||
|
||||
``` twig
|
||||
```twig
|
||||
{% raw %}
|
||||
this will {{ not be processed }}
|
||||
{% endraw %}
|
||||
|
||||
@@ -4,7 +4,8 @@ GitBook provides a serie of builtin filters and blocks to help you write templat
|
||||
|
||||
### Filters
|
||||
|
||||
`value|default(default, [boolean])`If value is strictly undefined, return default, otherwise value. If boolean is true, any JavaScript falsy value will return default (false, "", etc)
|
||||
`value|default(default, [boolean])`
|
||||
If value is strictly undefined, return default, otherwise value. If boolean is true, any JavaScript falsy value will return default (false, "", etc)
|
||||
|
||||
`arr|sort(reverse, caseSens, attr)`
|
||||
Sort arr with JavaScript's arr.sort function. If reverse is true, result will be reversed. Sort is case-insensitive by default, but setting caseSens to true makes it case-sensitive. If attr is passed, will compare attr from each item.
|
||||
|
||||
@@ -28,7 +28,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
|
||||
|
||||
Vendored
+1
-1
@@ -12,7 +12,7 @@ A theme is a plugin containing templates and assets. Overriding any individual t
|
||||
| -------- | ----------- |
|
||||
| `_layouts` | Main folder containing all the templates |
|
||||
| `_layouts/website/page.html` | Template for a normal page |
|
||||
| `_layouts/ebook/page.html` | Template for a normal page during ebook generation (PDF< ePub, Mobi) |
|
||||
| `_layouts/ebook/page.html` | Template for a normal page during ebook generation (PDF, ePub, Mobi) |
|
||||
|
||||
|
||||
### Extend/Customize theme in a book
|
||||
|
||||
@@ -9,7 +9,6 @@ const direction = require('direction');
|
||||
* @return {Page}
|
||||
*/
|
||||
function parsePageFromString(page, content) {
|
||||
// Parse page YAML
|
||||
const parsed = fm(content);
|
||||
|
||||
return page.merge({
|
||||
|
||||
Reference in New Issue
Block a user