Skip to content

Commit ca00b13

Browse files
committed
Add mdbook-toc to travis, book.toml and documentation
1 parent 93fcae6 commit ca00b13

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ install:
1313
- source ~/.cargo/env || true
1414
- cargo install mdbook --version '^0.4.5'
1515
- cargo install mdbook-linkcheck --version '^0.7.2'
16+
- cargo install mdbook-toc --version '^0.6.1'
1617
script:
1718
- git checkout -b ci
1819
- git rebase origin/master

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ rustdocs][rustdocs].
4040
To build a local static HTML site, install [`mdbook`](https://github.com/rust-lang/mdBook) with:
4141

4242
```
43-
> cargo install mdbook mdbook-linkcheck
43+
> cargo install mdbook mdbook-linkcheck mdbook-toc
4444
```
4545

4646
and execute the following command in the root of the repository:
@@ -56,6 +56,11 @@ The build files are found in the `book` directory.
5656
We use `mdbook-linkcheck` to validate URLs included in our documentation.
5757
`linkcheck` will be run automatically when you build with the instructions in the section above.
5858

59+
### Table of Contents
60+
61+
We use `mdbook-toc` to auto-generate TOCs for long sections. You can invoke the preprocessor by
62+
including the `<!-- toc -->` marker at the place where you want the TOC.
63+
5964
### Pre-commit script
6065

6166
We also test that line lengths are less than 100 columns. To test this locally,

book.toml

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ description = "A guide to developing rustc"
66
[build]
77
create-missing = false
88

9+
[preprocessor.toc]
10+
command = "mdbook-toc"
11+
renderer = ["html"]
12+
913
[output.html]
1014
git-repository-url = "https://github.com/rust-lang/rustc-dev-guide"
1115

0 commit comments

Comments
 (0)