You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**mdBook** is a command line tool and Rust library to create books using Markdown. It's very similar to Gitbook but written in [Rust](http://www.rust-lang.org).
3
+
**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).
4
4
5
-
This book serves as an example of the output of mdBook and as the docs at the same time.
5
+
What you are reading serves as an example of the output of mdBook and at the same time as high-level docs.
6
6
7
7
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).
8
8
9
9
## API docs
10
10
11
11
Alongside this book you can also read the [API docs](mdbook/index.html) generated by Rustdoc if you would like
12
-
to use mdBook as a crate or write a new renderer.
12
+
to use mdBook as a crate or write a new renderer and need a more low-level overview.
13
13
14
14
## License
15
15
16
-
mdBook, all the code and this book, are released under the [Mozilla Public License v2.0](https://www.mozilla.org/MPL/2.0/)
16
+
mdBook, all the source code, is released under the [Mozilla Public License v2.0](https://www.mozilla.org/MPL/2.0/)
Will create a couple of files and directories in the working directory so that you can
9
+
It will create a couple of files and directories in the working directory so that you can
10
10
spend more time writing your book and less setting it up.
11
11
12
12
The files set up for you are the following:
13
+
13
14
```
14
15
book-test/
15
16
├── book
@@ -22,14 +23,15 @@ The `src` directory is were you write your book in markdown. It contains all the
22
23
configuration files, etc.
23
24
24
25
The `book` directory is where your book is rendered. All the output is ready to be uploaded
25
-
to a serer to be seen by the internet.
26
+
to a server to be seen by the internet.
27
+
28
+
The `SUMMARY.md` file is the most important file, it's the skeleton of your book and is discussed in more detail in another [chapter](../format/summary.html).
26
29
27
-
The `SUMMARY.md` file is the most important file, it's the skeleton of your book.
28
-
It's so important that it has it's own [chapter](../format/summary.html).
30
+
When a `SUMMARY.md` file already exists, the `init` command will generate the files according to the paths used in the `SUMMARY.md`
29
31
30
32
#### Specify a directory
31
33
32
-
When using the init command, you can also specify a directory, instead of using the current directory,
34
+
When using the `init` command, you can also specify a directory, instead of using the current working directory,
33
35
by appending a path to the command:
34
36
35
37
```
@@ -43,10 +45,3 @@ called `theme` in your source directory so that you can modify it.
43
45
44
46
The theme is selectively overwritten, this means that if you don't want to overwrite a
45
47
specific file, just delete it and the default file will be used.
46
-
47
-
## Not yet implemented
48
-
49
-
In the future I would like `mdBook init` to be able to:
50
-
51
-
- Generate files that are in `SUMMARY.md`. If the user has already created a `SUMMARY.md` file and added some entries but did
52
-
not create the corresponding files, init command should create the files for him.
Copy file name to clipboardExpand all lines: book-example/src/format/summary.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,17 +14,19 @@ allow for easy parsing. Let's see how you should format your `SUMMARY.md` file.
14
14
But it is not mandatory, the parser just ignores it. So you can too
15
15
if you feel like it.
16
16
17
-
2.***list link*** the other elements have to be list elements in form of a link
17
+
2.***Prefix Chapter*** Before the main numbered chapters you can add a couple of elements that will not be numbered. This is useful for
18
+
forewords, introductions, etc. There are however some constraints. You can not nest prefix chapters, they should all be on the root level. And you can not add prefix chapters once you have added numbered chapters.
18
19
```markdown
19
-
- [Title of the Chapter](relative/path/to/markdown.md)
20
+
[Title of prefix element](relative/path/to/markdown.md)
20
21
```
21
-
You can either use `-` or `*` to indicate a list. The lists can be nested,
22
-
resulting in a nice hierarchy (chapters, sub-chapters, etc.)
23
22
24
-
All other elements are unsupported and will be ignored at best or result in an error.
23
+
3.***Numbered Chapter*** Numbered chapters are the main content of the book, they will be numbered and can be nested,
24
+
resulting in a nice hierarchy (chapters, sub-chapters, etc.)
25
+
```markdown
26
+
- [Title of the Chapter](relative/path/to/markdown.md)
27
+
```
28
+
You can either use `-` or `*` to indicate a numbered chapter.
25
29
26
-
#### not yet implemented
30
+
4.***Sufix Chapter*** After the numbered chapters you can add a couple of non-numbered chapters. They are the same as prefix chapters but come after the numbered chapters instead of before.
27
31
28
-
In the feature I would like to add support for links without the need to be list elements
29
-
at the root level to add chapters that don't need numbering, like an index, appendix,
30
-
contributor list, introduction, foreword, etc.
32
+
All other elements are unsupported and will be ignored at best or result in an error.
Copy file name to clipboardExpand all lines: book-example/src/format/theme/theme.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ Here are the files you can overwrite:
11
11
12
12
-***index.hbs*** is the handlebars template.
13
13
-***book.css*** is the style used in the output. If you want to change the design of your book, this is probably the file you want to modify. Sometimes in conjunction with `index.hbs` when you want to radically change the layout.
14
-
-***book.js*** is mostly used to add client side functionality.
14
+
-***book.js*** is mostly used to add client side functionality, like hiding / un-hiding the sidebar, changing the theme, ...
15
+
-***highlight.js*** is the JavaScript that is used to highlight code snippets, you should not need to modify this.
16
+
-***highlight.css*** is the theme used for the code highlighting
15
17
16
18
***Note:****When you overwrite a file, it is possible that you break some functionality. Therefore I recommend to use the file from the default theme as template and only add / modify what you need. You can copy the default theme into your source directory automatically by using `mdbook init --theme`.*
0 commit comments