Skip to content

Commit 18490f5

Browse files
authored
Merge pull request #27 from Michael-F-Bryan/linkcheck
Added the mdbook-linkcheck backend
2 parents 87ae827 + 04cee3e commit 18490f5

9 files changed

+33
-32
lines changed

.travis.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
language: rust
22
cache:
3-
- pip
43
- cargo
54
install:
65
- source ~/.cargo/env || true
76
- bash ci/install.sh
87
script:
9-
- true
10-
after_success:
11-
- bash ci/github_pages.sh
8+
- mdbook build
129
notifications:
1310
email:
1411
on_success: never

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,11 @@ for you to talk with someone who **does** know the code, or who wants
2525
to pair with you and figure it out. Then you can work on writing up
2626
what you learned.
2727

28+
To help prevent accidentally introducing broken links, we use the
29+
`mdbook-linkcheck`. If installed on your machine `mdbook` will automatically
30+
invoke this link checker, otherwise it will emit a warning saying it couldn't
31+
be found.
32+
33+
```
34+
$ cargo install mdbook-linkcheck
35+
```

book.toml

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ title = "Guide to Rustc Development"
33
author = "Rustc developers"
44
description = "A guide to developing rustc "
55

6+
[output.html]
7+
8+
[output.linkcheck]

ci/github_pages.sh

-11
This file was deleted.

ci/install.sh

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
#!/bin/bash
22
set -ex
33

4-
if command -v mdbook >/dev/null 2>&1; then
5-
echo "mdbook already installed at $(command -v mdbook)"
6-
else
7-
echo "installing mdbook"
8-
cargo install mdbook --vers "0.0.28"
9-
fi
4+
function cargo_install() {
5+
local name=$1
6+
local version=$2
107

11-
if command -v ghp-import >/dev/null 2>&1; then
12-
echo "ghp-import already installed at $(which ghp-import)"
13-
else
14-
echo "installing ghp-import"
15-
pip install --user ghp-import
16-
fi
8+
if command -v $name >/dev/null 2>&1; then
9+
echo "$name is already installed at $(command -v $name)"
10+
else
11+
echo "Installing $name"
12+
cargo install $name --version $version
13+
fi
14+
}
15+
16+
cargo_install mdbook 0.1.1
17+
cargo_install mdbook-linkcheck 0.1.0

src/high-level-overview.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The `rustc_driver` crate, at the top of this lattice, is effectively
4343
the "main" function for the rust compiler. It doesn't have much "real
4444
code", but instead ties together all of the code defined in the other
4545
crates and defines the overall flow of execution. (As we transition
46-
more and more to the [query model](ty/maps/README.md), however, the
46+
more and more to the [query model], however, the
4747
"flow" of compilation is becoming less centrally defined.)
4848

4949
At the other extreme, the `rustc` crate defines the common and
@@ -134,3 +134,6 @@ take:
134134
(one for each "codegen unit").
135135
6. **Linking**
136136
- Finally, those `.o` files are linked together.
137+
138+
139+
[query model]: query.html

src/macro-expansion.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,4 @@ TODO
158158
[code_mp]: https://github.com/rust-lang/rust/tree/master/src/libsyntax/ext/tt/macro_parser.rs
159159
[code_mp]: https://github.com/rust-lang/rust/tree/master/src/libsyntax/ext/tt/macro_rules.rs
160160
[code_parse_int]: https://github.com/rust-lang/rust/blob/a97cd17f5d71fb4ec362f4fbd79373a6e7ed7b82/src/libsyntax/ext/tt/macro_parser.rs#L421
161-
[parsing]: ./the-parser.md
161+
[parsing]: ./the-parser.html

src/ty.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ is in fact a simple type alias for a reference with `'tcx` lifetime:
7878
pub type Ty<'tcx> = &'tcx TyS<'tcx>;
7979
```
8080

81-
[the HIR]: ../hir/README.md
81+
[the HIR]: ./hir.html
8282

8383
You can basically ignore the `TyS` struct -- you will basically never
8484
access it explicitly. We always pass it by reference using the

src/type-inference.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fresh types and things that it will create, as described in
3232
[the README in the ty module][ty-readme]. This arena is created by the `enter`
3333
function and disposed after it returns.
3434

35-
[ty-readme]: src/librustc/ty/README.md
35+
[ty-readme]: ty.html
3636

3737
Within the closure, the infcx will have the type `InferCtxt<'cx, 'gcx,
3838
'tcx>` for some fresh `'cx` and `'tcx` -- the latter corresponds to
@@ -107,7 +107,7 @@ actual return type is not `()`, but rather `InferOk<()>`. The
107107
to ensure that these are fulfilled (typically by enrolling them in a
108108
fulfillment context). See the [trait README] for more background here.
109109

110-
[trait README]: ../traits/README.md
110+
[trait README]: trait-resolution.html
111111

112112
You can also enforce subtyping through `infcx.at(..).sub(..)`. The same
113113
basic concepts apply as above.

0 commit comments

Comments
 (0)