File tree 3 files changed +11
-1
lines changed
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ install:
13
13
- source ~/.cargo/env || true
14
14
- cargo install mdbook --version '^0.4.5'
15
15
- cargo install mdbook-linkcheck --version '^0.7.2'
16
+ - cargo install mdbook-toc --version '^0.6.1'
16
17
script :
17
18
- git checkout -b ci
18
19
- git rebase origin/master
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ rustdocs][rustdocs].
40
40
To build a local static HTML site, install [ ` mdbook ` ] ( https://github.com/rust-lang/mdBook ) with:
41
41
42
42
```
43
- > cargo install mdbook mdbook-linkcheck
43
+ > cargo install mdbook mdbook-linkcheck mdbook-toc
44
44
```
45
45
46
46
and execute the following command in the root of the repository:
@@ -56,6 +56,11 @@ The build files are found in the `book` directory.
56
56
We use ` mdbook-linkcheck ` to validate URLs included in our documentation.
57
57
` linkcheck ` will be run automatically when you build with the instructions in the section above.
58
58
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
+
59
64
### Pre-commit script
60
65
61
66
We also test that line lengths are less than 100 columns. To test this locally,
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ description = "A guide to developing rustc"
6
6
[build ]
7
7
create-missing = false
8
8
9
+ [preprocessor .toc ]
10
+ command = " mdbook-toc"
11
+ renderer = [" html" ]
12
+
9
13
[output .html ]
10
14
git-repository-url = " https://github.com/rust-lang/rustc-dev-guide"
11
15
You can’t perform that action at this time.
0 commit comments