Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for 0.1.0 #401

Merged
merged 3 commits into from
Aug 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions book-example/book.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
title = "mdBook Documentation"
description = "Create book from markdown files. Like Gitbook but implemented in Rust"
author = "Mathieu David"

[output.html]
mathjax-support = true
2 changes: 1 addition & 1 deletion book-example/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**mdBook** is a command line tool and Rust crate to create books using Markdown files. It's very similar to Gitbook but written in [Rust](http://www.rust-lang.org).

What you are reading serves as an example of the output of mdBook and at the same time as high-level docs.
What you are reading serves as an example of the output of mdBook and at the same time as a high-level documentation.

mdBook is free and open source, you can find the source code on [Github](https://github.com/azerupi/mdBook). Issues and feature requests can be posted on the [Github Issue tracker](https://github.com/azerupi/mdBook/issues).

Expand Down
15 changes: 9 additions & 6 deletions book-example/src/format/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

You can configure the parameters for your book in the ***book.toml*** file.

**Note:** JSON configuration files were previously supported but have been deprecated in favor of
>**Note:**
JSON configuration files were previously supported but have been deprecated in favor of
the TOML configuration file. If you are still using JSON we strongly encourage you to migrate to
the TOML configuration because JSON support will be removed in the future.

Expand Down Expand Up @@ -63,12 +64,13 @@ source = "my-src" # the source files will be found in `root/my-src` instead of
The HTML renderer has a couple of options aswell. All the options for the renderer need to be specified under the TOML table `[output.html]`.
The following configuration options are available:

- **destination:** By default, the HTML book will be rendered in the `root/book` directory, but this option lets you specify another
- **`destination`:** By default, the HTML book will be rendered in the `root/book` directory, but this option lets you specify another
destination fodler.
- **theme:** mdBook comes with a default theme and all the resource files needed for it. But if this option is set, mdBook will selectively overwrite the theme files with the ones found in the specified folder.
- **curly-quotes:** Convert straight quotes to curly quotes, except for those that occur in code blocks and code spans. Defaults to `false`.
- **google-analytics:** If you use Google Analytics, this option lets you enable it by simply specifying your ID in the configuration file.
- **additional-css:** If you need to slightly change the appearance of your book without overwriting the whole style, you can specify a set of stylesheets that will be loaded after the default ones where you can surgically change the style.
- **`theme`:** mdBook comes with a default theme and all the resource files needed for it. But if this option is set, mdBook will selectively overwrite the theme files with the ones found in the specified folder.
- **`curly-quotes`:** Convert straight quotes to curly quotes, except for those that occur in code blocks and code spans. Defaults to `false`.
- **`google-analytics`:** If you use Google Analytics, this option lets you enable it by simply specifying your ID in the configuration file.
- **`additional-css`:** If you need to slightly change the appearance of your book without overwriting the whole style, you can specify a set of stylesheets that will be loaded after the default ones where you can surgically change the style.
- **`additional-js`:** If you need to add some behaviour to your book without removing the current behaviour, you can specify a set of javascript files that will be loaded alongside the default one.

**book.toml**
```toml
Expand All @@ -82,5 +84,6 @@ theme = "my-theme"
curly-quotes = true
google-analytics = "123456"
additional-css = ["custom.css", "custom2.css"]
additional-js = ["custom.js"]
```

22 changes: 16 additions & 6 deletions book-example/src/format/mathjax.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
# MathJax Support

mdBook supports math equations through [MathJax](https://www.mathjax.org/).
mdBook has optional support for math equations through [MathJax](https://www.mathjax.org/).

**However the normal method for indication math equations with `$$` does not work (yet?).**
To enable MathJax, you need to add the `mathjax-support` key to your `book.toml` under the `output.html` section.

To indicate an inline equation \\( \int x = \frac{x^2}{2} \\) use
```toml
[output.html]
mathjax-support = true
```
\\( \int x = \frac{x^2}{2} \\)

>**Note:**
The usual delimiters MathJax uses are not yet supported. You can't currently use `$$ ... $$` as delimiters and the `\[ ... \]` delimiters need an extra backslash to work. Hopefully this limitation will be lifted soon.

### Inline equations
Inline equations are delimited by `\\[` and `\\]`. So for example, to render the following inline equation \\( \int x dx = \frac{x^2}{2} + C \\) you would write the following:
```
\\( \int x dx = \frac{x^2}{2} + C \\)
```

To indicate a block equation
### Block equations
Block equations are delimited by `\\[` and `\\]`. To render the following equation

\\[ \mu = \frac{1}{N} \sum_{i=0} x_i \\]


use
you would write:

```bash
\\[ \mu = \frac{1}{N} \sum_{i=0} x_i \\]
Expand Down