Skip to content

Commit 66390c9

Browse files
ehusstraviscross
authored andcommitted
Add a chapter describing mdbook-spec
1 parent 36b2d2d commit 66390c9

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

reference-dev-guide/src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- [Publishing process](publishing.md)
66
- [Reference tooling]()
77
- [Building the Reference](tooling/building.md)
8-
- [mdbook-spec]()
8+
- [mdbook-spec](tooling/mdbook-spec.md)
99
- [Tests]()
1010
- [Formatting]()
1111
- [Markdown]()
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# mdbook-spec
2+
3+
[`mdbook-spec`] is an mdBook preprocessor that adds features to the Reference. It provides:
4+
5+
- Parsing and generation of [grammar diagrams].
6+
- [Automatic grammar production links].
7+
- Generation of the [grammar summary appendix].
8+
- [Automatic standard library links].
9+
- Handling of [rule names].
10+
- Validation of the names.
11+
- Converting rule names to links.
12+
- [Automatic rule link references].
13+
- Generation of [links to rule tests].
14+
- Generation of the [test summary].
15+
- Support for [admonitions].
16+
17+
## Environment variables
18+
19+
There are a few environment variables that `mdbook-spec` uses, described in the [building chapter]:
20+
21+
- [`SPEC_RELATIVE`] --- Can be set to link external books to the live site.
22+
- [`SPEC_DENY_WARNINGS`] --- Whether warnings should be treated as errors.
23+
- [`SPEC_RUST_ROOT`] --- The path to a checkout of the [`rust-lang/rust`] GitHub repository. This is used for test linking.
24+
25+
[`mdbook-spec`]: https://github.com/rust-lang/reference/tree/master/mdbook-spec
26+
[`rust-lang/rust`]: https://github.com/rust-lang/rust
27+
[`SPEC_DENY_WARNINGS`]: building.md#SPEC_DENY_WARNINGS
28+
[`SPEC_RELATIVE`]: building.md#SPEC_RELATIVE
29+
[`SPEC_RUST_ROOT`]: building.md#SPEC_RUST_ROOT
30+
[admonitions]: ../formatting/admonitions.md
31+
[Automatic grammar production links]: ../grammar.md#automatic-linking
32+
[Automatic rule link references]: ../links.md#rule-links
33+
[Automatic standard library links]: ../links.md#standard-library-links
34+
[Building chapter]: building.md
35+
[grammar diagrams]: ../grammar.md
36+
[grammar summary appendix]: https://doc.rust-lang.org/nightly/reference/grammar.html
37+
[links to rule tests]: ../rules/test-annotations.md
38+
[rule names]: ../rules/index.md
39+
[test summary]: https://doc.rust-lang.org/nightly/reference/test-summary.html

0 commit comments

Comments
 (0)