From 70c9022cf6839ed905f6e4b90ad3ec5ec9be7e72 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 27 Jan 2019 10:13:59 -0800 Subject: [PATCH 1/2] Add linkchecker. --- .travis.yml | 3 ++- tests/linkcheck.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 tests/linkcheck.sh diff --git a/.travis.yml b/.travis.yml index de1a08fd0..83744b001 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,5 @@ install: script: - export PATH=$PATH:/home/travis/.cargo/bin && mdbook test - - cd stable-check && cargo run -- ../src + - (cd stable-check && cargo run -- ../src) + - tests/linkcheck.sh diff --git a/tests/linkcheck.sh b/tests/linkcheck.sh new file mode 100755 index 000000000..2bbf5422d --- /dev/null +++ b/tests/linkcheck.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +if [ ! -f book.toml ] +then + echo "Run command in root directory with book.toml" + exit 1 +fi + +rm -rf tests/linkcheck tests/linkchecker + +mkdir tests/linkchecker +curl -o tests/linkchecker/Cargo.toml https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/Cargo.toml +curl -o tests/linkchecker/main.rs https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/main.rs + +mdbook build + +cp -R $(rustc --print sysroot)/share/doc/rust/html tests/linkcheck +rm -rf tests/linkcheck/reference +cp -R book tests/linkcheck/reference + +cargo run --manifest-path=tests/linkchecker/Cargo.toml -- tests/linkcheck/reference + +rm -rf tests/linkcheck tests/linkchecker +echo "Linkcheck completed successfully!" From d4544a7a3bb725089b63cee724328f50009e5326 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 27 Jan 2019 10:28:42 -0800 Subject: [PATCH 2/2] Fix transmute link to std. Paths are relative to the document root in mdbook 0.1. --- src/items/unions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/items/unions.md b/src/items/unions.md index 43dc720cc..27c7668a2 100644 --- a/src/items/unions.md +++ b/src/items/unions.md @@ -152,4 +152,4 @@ checking, etc etc etc). [_Generics_]: items/generics.html [_WhereClause_]: items/generics.html#where-clauses [_StructFields_]: items/structs.html -[`transmute`]: ../../std/mem/fn.transmute.html +[`transmute`]: ../std/mem/fn.transmute.html