Merge pull request #27 from Michael-F-Bryan/linkcheck

Added the mdbook-linkcheck backend
This commit is contained in:
Niko Matsakis 2018-01-31 14:20:36 -05:00 committed by GitHub
commit 18490f564d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 33 additions and 32 deletions

View File

@ -1,14 +1,11 @@
language: rust
cache:
- pip
- cargo
install:
- source ~/.cargo/env || true
- bash ci/install.sh
script:
- true
after_success:
- bash ci/github_pages.sh
- mdbook build
notifications:
email:
on_success: never

View File

@ -25,3 +25,11 @@ for you to talk with someone who **does** know the code, or who wants
to pair with you and figure it out. Then you can work on writing up
what you learned.
To help prevent accidentally introducing broken links, we use the
`mdbook-linkcheck`. If installed on your machine `mdbook` will automatically
invoke this link checker, otherwise it will emit a warning saying it couldn't
be found.
```
$ cargo install mdbook-linkcheck
```

View File

@ -3,3 +3,6 @@ title = "Guide to Rustc Development"
author = "Rustc developers"
description = "A guide to developing rustc "
[output.html]
[output.linkcheck]

View File

@ -1,11 +0,0 @@
#!/bin/bash
set -ex
BOOK_DIR=book
# Only upload the built book to github pages if it's a commit to master
if [ "$TRAVIS_BRANCH" = master -a "$TRAVIS_PULL_REQUEST" = false ]; then
mdbook build
else
echo Skipping 'mdbook build' because this is not master or this is just a PR.
fi

View File

@ -1,16 +1,17 @@
#!/bin/bash
set -ex
if command -v mdbook >/dev/null 2>&1; then
echo "mdbook already installed at $(command -v mdbook)"
else
echo "installing mdbook"
cargo install mdbook --vers "0.0.28"
fi
function cargo_install() {
local name=$1
local version=$2
if command -v ghp-import >/dev/null 2>&1; then
echo "ghp-import already installed at $(which ghp-import)"
else
echo "installing ghp-import"
pip install --user ghp-import
fi
if command -v $name >/dev/null 2>&1; then
echo "$name is already installed at $(command -v $name)"
else
echo "Installing $name"
cargo install $name --version $version
fi
}
cargo_install mdbook 0.1.1
cargo_install mdbook-linkcheck 0.1.0

View File

@ -43,7 +43,7 @@ The `rustc_driver` crate, at the top of this lattice, is effectively
the "main" function for the rust compiler. It doesn't have much "real
code", but instead ties together all of the code defined in the other
crates and defines the overall flow of execution. (As we transition
more and more to the [query model](ty/maps/README.md), however, the
more and more to the [query model], however, the
"flow" of compilation is becoming less centrally defined.)
At the other extreme, the `rustc` crate defines the common and
@ -134,3 +134,6 @@ take:
(one for each "codegen unit").
6. **Linking**
- Finally, those `.o` files are linked together.
[query model]: query.html

View File

@ -158,4 +158,4 @@ TODO
[code_mp]: https://github.com/rust-lang/rust/tree/master/src/libsyntax/ext/tt/macro_parser.rs
[code_mp]: https://github.com/rust-lang/rust/tree/master/src/libsyntax/ext/tt/macro_rules.rs
[code_parse_int]: https://github.com/rust-lang/rust/blob/a97cd17f5d71fb4ec362f4fbd79373a6e7ed7b82/src/libsyntax/ext/tt/macro_parser.rs#L421
[parsing]: ./the-parser.md
[parsing]: ./the-parser.html

View File

@ -78,7 +78,7 @@ is in fact a simple type alias for a reference with `'tcx` lifetime:
pub type Ty<'tcx> = &'tcx TyS<'tcx>;
```
[the HIR]: ../hir/README.md
[the HIR]: ./hir.html
You can basically ignore the `TyS` struct -- you will basically never
access it explicitly. We always pass it by reference using the

View File

@ -32,7 +32,7 @@ fresh types and things that it will create, as described in
[the README in the ty module][ty-readme]. This arena is created by the `enter`
function and disposed after it returns.
[ty-readme]: src/librustc/ty/README.md
[ty-readme]: ty.html
Within the closure, the infcx will have the type `InferCtxt<'cx, 'gcx,
'tcx>` for some fresh `'cx` and `'tcx` -- the latter corresponds to
@ -107,7 +107,7 @@ actual return type is not `()`, but rather `InferOk<()>`. The
to ensure that these are fulfilled (typically by enrolling them in a
fulfillment context). See the [trait README] for more background here.
[trait README]: ../traits/README.md
[trait README]: trait-resolution.html
You can also enforce subtyping through `infcx.at(..).sub(..)`. The same
basic concepts apply as above.