Skip to content

Commit

Permalink
Auto merge of #7140 - ehuss:update-mdbook, r=alexcrichton
Browse files Browse the repository at this point in the history
Update mdbook to 0.3.

This updates to mdbook 0.3 which uses relative links, which are much better
(the pages mostly work when viewing on GitHub for example).
  • Loading branch information
bors committed Jul 16, 2019
2 parents be17b00 + b119b89 commit f4aca6d
Show file tree
Hide file tree
Showing 55 changed files with 425 additions and 403 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ matrix:
ALT=i686-unknown-linux-gnu
rust: nightly
install:
- travis_retry curl -Lf https://github.com/rust-lang-nursery/mdBook/releases/download/v0.1.7/mdbook-v0.1.7-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=$HOME/.cargo/bin
- travis_retry curl -Lf https://github.com/rust-lang-nursery/mdBook/releases/download/v0.3.1/mdbook-v0.3.1-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=$HOME/.cargo/bin
script:
- cargo test --features=deny-warnings || travis_terminate 1
- cargo doc --no-deps || travis_terminate 1
Expand Down
2 changes: 1 addition & 1 deletion src/doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Building the book requires [mdBook]. To get it:

[mdBook]: https://github.com/azerupi/mdBook
[mdBook]: https://github.com/rust-lang-nursery/mdBook

```console
$ cargo install mdbook
Expand Down
9 changes: 5 additions & 4 deletions src/doc/asciidoc-extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def process parent, target, attrs
elsif manname == 'rustdoc'
html_target = 'https://doc.rust-lang.org/rustdoc/index.html'
elsif manname == 'cargo'
html_target = 'commands/index.html'
html_target = 'index.html'
else
html_target = %(commands/#{manname}.html)
html_target = %(#{manname}.html)
end
%(#{(create_anchor parent, text, type: :link, target: html_target).render})
elsif parent.document.backend == 'manpage'
Expand All @@ -44,8 +44,8 @@ def process parent, target, attrs

# Creates a link to something in the cargo documentation.
#
# For HTML this creates a relative link (using mdbook's 0.1's base-style
# links). For the man page it gives a direct link to doc.rust-lang.org.
# For HTML this creates a relative link. For the man page it gives a direct
# link to doc.rust-lang.org.
#
# Usage
#
Expand All @@ -60,6 +60,7 @@ class LinkCargoInlineMacro < Extensions::InlineMacroProcessor
def process parent, target, attrs
text = attrs['text']
if parent.document.basebackend? 'html'
target = %(../#{target})
parent.document.register :links, target
%(#{(create_anchor parent, text, type: :link, target: target).render})
elsif parent.document.backend == 'manpage'
Expand Down
4 changes: 4 additions & 0 deletions src/doc/book.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[book]
title = "The Cargo Book"
author = "Alex Crichton, Steve Klabnik and Carol Nichols, with Contributions from the Rust Community"

[output.html]
git-repository-url = "https://github.com/rust-lang/cargo/tree/master/src/doc/src"
24 changes: 12 additions & 12 deletions src/doc/man/generated/cargo-bench.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h3 id="cargo_bench_package_selection">Package Selection</h3>
<dt class="hdlist1"><strong>-p</strong> <em>SPEC</em>&#8230;&#8203;</dt>
<dt class="hdlist1"><strong>--package</strong> <em>SPEC</em>&#8230;&#8203;</dt>
<dd>
<p>Benchmark only the specified packages. See <a href="commands/cargo-pkgid.html">cargo-pkgid(1)</a> for the
<p>Benchmark only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
Expand Down Expand Up @@ -230,7 +230,7 @@ <h3 id="cargo_bench_compilation_options">Compilation Options</h3>
list of supported targets.</p>
<div class="paragraph">
<p>This may also be specified with the <code>build.target</code>
<a href="reference/config.html">config value</a>.</p>
<a href="../reference/config.html">config value</a>.</p>
</div>
</dd>
</dl>
Expand All @@ -244,7 +244,7 @@ <h3 id="cargo_bench_output_options">Output Options</h3>
<dd>
<p>Directory for all generated artifacts and intermediate files. May also be
specified with the <code>CARGO_TARGET_DIR</code> environment variable, or the
<code>build.target-dir</code> <a href="reference/config.html">config value</a>. Defaults
<code>build.target-dir</code> <a href="../reference/config.html">config value</a>. Defaults
to <code>target</code> in the root of the workspace.</p>
</dd>
</dl>
Expand All @@ -270,7 +270,7 @@ <h3 id="cargo_bench_display_options">Display Options</h3>
<p>Use verbose output. May be specified twice for "very verbose" output which
includes extra output such as dependency warnings and build script output.
May also be specified with the <code>term.verbose</code>
<a href="reference/config.html">config value</a>.</p>
<a href="../reference/config.html">config value</a>.</p>
</dd>
<dt class="hdlist1"><strong>-q</strong></dt>
<dt class="hdlist1"><strong>--quiet</strong></dt>
Expand All @@ -296,7 +296,7 @@ <h3 id="cargo_bench_display_options">Display Options</h3>
</div>
<div class="paragraph">
<p>May also be specified with the <code>term.color</code>
<a href="reference/config.html">config value</a>.</p>
<a href="../reference/config.html">config value</a>.</p>
</div>
</dd>
<dt class="hdlist1"><strong>--message-format</strong> <em>FMT</em></dt>
Expand Down Expand Up @@ -351,11 +351,11 @@ <h3 id="cargo_bench_manifest_options">Manifest Options</h3>
<p>Beware that this may result in different dependency resolution than online
mode. Cargo will restrict itself to crates that are downloaded locally, even
if there might be a newer version as indicated in the local copy of the index.
See the <a href="commands/cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
See the <a href="cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
offline.</p>
</div>
<div class="paragraph">
<p>May also be specified with the <code>net.offline</code> <a href="reference/config.html">config value</a>.</p>
<p>May also be specified with the <code>net.offline</code> <a href="../reference/config.html">config value</a>.</p>
</div>
</dd>
</dl>
Expand Down Expand Up @@ -391,7 +391,7 @@ <h3 id="cargo_bench_miscellaneous_options">Miscellaneous Options</h3>
<dt class="hdlist1"><strong>--jobs</strong> <em>N</em></dt>
<dd>
<p>Number of parallel jobs to run. May also be specified with the
<code>build.jobs</code> <a href="reference/config.html">config value</a>. Defaults to
<code>build.jobs</code> <a href="../reference/config.html">config value</a>. Defaults to
the number of CPUs.</p>
</dd>
</dl>
Expand All @@ -405,7 +405,7 @@ <h2 id="cargo_bench_profiles">PROFILES</h2>
<div class="paragraph">
<p>Profiles may be used to configure compiler options such as optimization levels
and debug settings. See
<a href="reference/manifest.html#the-profile-sections">the reference</a>
<a href="../reference/manifest.html#the-profile-sections">the reference</a>
for more details.</p>
</div>
<div class="paragraph">
Expand All @@ -416,7 +416,7 @@ <h2 id="cargo_bench_profiles">PROFILES</h2>
</div>
<div class="paragraph">
<p>If you need a debug build of a benchmark, try building it with
<a href="commands/cargo-build.html">cargo-build(1)</a> which will use the <code>test</code> profile which is by default
<a href="cargo-build.html">cargo-build(1)</a> which will use the <code>test</code> profile which is by default
unoptimized and includes debug information. You can then run the debug-enabled
benchmark manually.</p>
</div>
Expand All @@ -426,7 +426,7 @@ <h2 id="cargo_bench_profiles">PROFILES</h2>
<h2 id="cargo_bench_environment">ENVIRONMENT</h2>
<div class="sectionbody">
<div class="paragraph">
<p>See <a href="reference/environment-variables.html">the reference</a> for
<p>See <a href="../reference/environment-variables.html">the reference</a> for
details on environment variables that Cargo reads.</p>
</div>
</div>
Expand Down Expand Up @@ -477,7 +477,7 @@ <h2 id="cargo_bench_examples">EXAMPLES</h2>
<h2 id="cargo_bench_see_also">SEE ALSO</h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="commands/index.html">cargo(1)</a>, <a href="commands/cargo-test.html">cargo-test(1)</a></p>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-test.html">cargo-test(1)</a></p>
</div>
</div>
</div>
22 changes: 11 additions & 11 deletions src/doc/man/generated/cargo-build.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h3 id="cargo_build_package_selection">Package Selection</h3>
<dt class="hdlist1"><strong>-p</strong> <em>SPEC</em>&#8230;&#8203;</dt>
<dt class="hdlist1"><strong>--package</strong> <em>SPEC</em>&#8230;&#8203;</dt>
<dd>
<p>Build only the specified packages. See <a href="commands/cargo-pkgid.html">cargo-pkgid(1)</a> for the
<p>Build only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
Expand Down Expand Up @@ -159,7 +159,7 @@ <h3 id="cargo_build_compilation_options">Compilation Options</h3>
list of supported targets.</p>
<div class="paragraph">
<p>This may also be specified with the <code>build.target</code>
<a href="reference/config.html">config value</a>.</p>
<a href="../reference/config.html">config value</a>.</p>
</div>
</dd>
<dt class="hdlist1"><strong>--release</strong></dt>
Expand All @@ -178,7 +178,7 @@ <h3 id="cargo_build_output_options">Output Options</h3>
<dd>
<p>Directory for all generated artifacts and intermediate files. May also be
specified with the <code>CARGO_TARGET_DIR</code> environment variable, or the
<code>build.target-dir</code> <a href="reference/config.html">config value</a>. Defaults
<code>build.target-dir</code> <a href="../reference/config.html">config value</a>. Defaults
to <code>target</code> in the root of the workspace.</p>
</dd>
<dt class="hdlist1"><strong>--out-dir</strong> <em>DIRECTORY</em></dt>
Expand All @@ -204,7 +204,7 @@ <h3 id="cargo_build_display_options">Display Options</h3>
<p>Use verbose output. May be specified twice for "very verbose" output which
includes extra output such as dependency warnings and build script output.
May also be specified with the <code>term.verbose</code>
<a href="reference/config.html">config value</a>.</p>
<a href="../reference/config.html">config value</a>.</p>
</dd>
<dt class="hdlist1"><strong>-q</strong></dt>
<dt class="hdlist1"><strong>--quiet</strong></dt>
Expand All @@ -230,7 +230,7 @@ <h3 id="cargo_build_display_options">Display Options</h3>
</div>
<div class="paragraph">
<p>May also be specified with the <code>term.color</code>
<a href="reference/config.html">config value</a>.</p>
<a href="../reference/config.html">config value</a>.</p>
</div>
</dd>
<dt class="hdlist1"><strong>--message-format</strong> <em>FMT</em></dt>
Expand Down Expand Up @@ -296,11 +296,11 @@ <h3 id="cargo_build_manifest_options">Manifest Options</h3>
<p>Beware that this may result in different dependency resolution than online
mode. Cargo will restrict itself to crates that are downloaded locally, even
if there might be a newer version as indicated in the local copy of the index.
See the <a href="commands/cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
See the <a href="cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
offline.</p>
</div>
<div class="paragraph">
<p>May also be specified with the <code>net.offline</code> <a href="reference/config.html">config value</a>.</p>
<p>May also be specified with the <code>net.offline</code> <a href="../reference/config.html">config value</a>.</p>
</div>
</dd>
</dl>
Expand Down Expand Up @@ -331,7 +331,7 @@ <h3 id="cargo_build_miscellaneous_options">Miscellaneous Options</h3>
<dt class="hdlist1"><strong>--jobs</strong> <em>N</em></dt>
<dd>
<p>Number of parallel jobs to run. May also be specified with the
<code>build.jobs</code> <a href="reference/config.html">config value</a>. Defaults to
<code>build.jobs</code> <a href="../reference/config.html">config value</a>. Defaults to
the number of CPUs.</p>
</dd>
</dl>
Expand All @@ -345,7 +345,7 @@ <h2 id="cargo_build_profiles">PROFILES</h2>
<div class="paragraph">
<p>Profiles may be used to configure compiler options such as optimization levels
and debug settings. See
<a href="reference/manifest.html#the-profile-sections">the reference</a>
<a href="../reference/manifest.html#the-profile-sections">the reference</a>
for more details.</p>
</div>
<div class="paragraph">
Expand Down Expand Up @@ -389,7 +389,7 @@ <h2 id="cargo_build_profiles">PROFILES</h2>
<h2 id="cargo_build_environment">ENVIRONMENT</h2>
<div class="sectionbody">
<div class="paragraph">
<p>See <a href="reference/environment-variables.html">the reference</a> for
<p>See <a href="../reference/environment-variables.html">the reference</a> for
details on environment variables that Cargo reads.</p>
</div>
</div>
Expand Down Expand Up @@ -440,7 +440,7 @@ <h2 id="cargo_build_examples">EXAMPLES</h2>
<h2 id="cargo_build_see_also">SEE ALSO</h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="commands/index.html">cargo(1)</a>, <a href="commands/cargo-rustc.html">cargo-rustc(1)</a></p>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-rustc.html">cargo-rustc(1)</a></p>
</div>
</div>
</div>
22 changes: 11 additions & 11 deletions src/doc/man/generated/cargo-check.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h3 id="cargo_check_package_selection">Package Selection</h3>
<dt class="hdlist1"><strong>-p</strong> <em>SPEC</em>&#8230;&#8203;</dt>
<dt class="hdlist1"><strong>--package</strong> <em>SPEC</em>&#8230;&#8203;</dt>
<dd>
<p>Check only the specified packages. See <a href="commands/cargo-pkgid.html">cargo-pkgid(1)</a> for the
<p>Check only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
SPEC format. This flag may be specified multiple times.</p>
</dd>
<dt class="hdlist1"><strong>--all</strong></dt>
Expand Down Expand Up @@ -163,7 +163,7 @@ <h3 id="cargo_check_compilation_options">Compilation Options</h3>
list of supported targets.</p>
<div class="paragraph">
<p>This may also be specified with the <code>build.target</code>
<a href="reference/config.html">config value</a>.</p>
<a href="../reference/config.html">config value</a>.</p>
</div>
</dd>
<dt class="hdlist1"><strong>--release</strong></dt>
Expand All @@ -190,7 +190,7 @@ <h3 id="cargo_check_output_options">Output Options</h3>
<dd>
<p>Directory for all generated artifacts and intermediate files. May also be
specified with the <code>CARGO_TARGET_DIR</code> environment variable, or the
<code>build.target-dir</code> <a href="reference/config.html">config value</a>. Defaults
<code>build.target-dir</code> <a href="../reference/config.html">config value</a>. Defaults
to <code>target</code> in the root of the workspace.</p>
</dd>
</dl>
Expand All @@ -206,7 +206,7 @@ <h3 id="cargo_check_display_options">Display Options</h3>
<p>Use verbose output. May be specified twice for "very verbose" output which
includes extra output such as dependency warnings and build script output.
May also be specified with the <code>term.verbose</code>
<a href="reference/config.html">config value</a>.</p>
<a href="../reference/config.html">config value</a>.</p>
</dd>
<dt class="hdlist1"><strong>-q</strong></dt>
<dt class="hdlist1"><strong>--quiet</strong></dt>
Expand All @@ -232,7 +232,7 @@ <h3 id="cargo_check_display_options">Display Options</h3>
</div>
<div class="paragraph">
<p>May also be specified with the <code>term.color</code>
<a href="reference/config.html">config value</a>.</p>
<a href="../reference/config.html">config value</a>.</p>
</div>
</dd>
<dt class="hdlist1"><strong>--message-format</strong> <em>FMT</em></dt>
Expand Down Expand Up @@ -287,11 +287,11 @@ <h3 id="cargo_check_manifest_options">Manifest Options</h3>
<p>Beware that this may result in different dependency resolution than online
mode. Cargo will restrict itself to crates that are downloaded locally, even
if there might be a newer version as indicated in the local copy of the index.
See the <a href="commands/cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
See the <a href="cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
offline.</p>
</div>
<div class="paragraph">
<p>May also be specified with the <code>net.offline</code> <a href="reference/config.html">config value</a>.</p>
<p>May also be specified with the <code>net.offline</code> <a href="../reference/config.html">config value</a>.</p>
</div>
</dd>
</dl>
Expand Down Expand Up @@ -322,7 +322,7 @@ <h3 id="cargo_check_miscellaneous_options">Miscellaneous Options</h3>
<dt class="hdlist1"><strong>--jobs</strong> <em>N</em></dt>
<dd>
<p>Number of parallel jobs to run. May also be specified with the
<code>build.jobs</code> <a href="reference/config.html">config value</a>. Defaults to
<code>build.jobs</code> <a href="../reference/config.html">config value</a>. Defaults to
the number of CPUs.</p>
</dd>
</dl>
Expand All @@ -336,7 +336,7 @@ <h2 id="cargo_check_profiles">PROFILES</h2>
<div class="paragraph">
<p>Profiles may be used to configure compiler options such as optimization levels
and debug settings. See
<a href="reference/manifest.html#the-profile-sections">the reference</a>
<a href="../reference/manifest.html#the-profile-sections">the reference</a>
for more details.</p>
</div>
<div class="paragraph">
Expand Down Expand Up @@ -380,7 +380,7 @@ <h2 id="cargo_check_profiles">PROFILES</h2>
<h2 id="cargo_check_environment">ENVIRONMENT</h2>
<div class="sectionbody">
<div class="paragraph">
<p>See <a href="reference/environment-variables.html">the reference</a> for
<p>See <a href="../reference/environment-variables.html">the reference</a> for
details on environment variables that Cargo reads.</p>
</div>
</div>
Expand Down Expand Up @@ -431,7 +431,7 @@ <h2 id="cargo_check_examples">EXAMPLES</h2>
<h2 id="cargo_check_see_also">SEE ALSO</h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="commands/index.html">cargo(1)</a>, <a href="commands/cargo-build.html">cargo-build(1)</a></p>
<p><a href="index.html">cargo(1)</a>, <a href="cargo-build.html">cargo-build(1)</a></p>
</div>
</div>
</div>
Loading

0 comments on commit f4aca6d

Please sign in to comment.