Skip to content

Commit f4aca6d

Browse files
committed
Auto merge of #7140 - ehuss:update-mdbook, r=alexcrichton
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).
2 parents be17b00 + b119b89 commit f4aca6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+425
-403
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ matrix:
4242
ALT=i686-unknown-linux-gnu
4343
rust: nightly
4444
install:
45-
- 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
45+
- 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
4646
script:
4747
- cargo test --features=deny-warnings || travis_terminate 1
4848
- cargo doc --no-deps || travis_terminate 1

src/doc/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

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

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

1010
```console
1111
$ cargo install mdbook

src/doc/asciidoc-extension.rb

+5-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def process parent, target, attrs
2929
elsif manname == 'rustdoc'
3030
html_target = 'https://doc.rust-lang.org/rustdoc/index.html'
3131
elsif manname == 'cargo'
32-
html_target = 'commands/index.html'
32+
html_target = 'index.html'
3333
else
34-
html_target = %(commands/#{manname}.html)
34+
html_target = %(#{manname}.html)
3535
end
3636
%(#{(create_anchor parent, text, type: :link, target: html_target).render})
3737
elsif parent.document.backend == 'manpage'
@@ -44,8 +44,8 @@ def process parent, target, attrs
4444

4545
# Creates a link to something in the cargo documentation.
4646
#
47-
# For HTML this creates a relative link (using mdbook's 0.1's base-style
48-
# links). For the man page it gives a direct link to doc.rust-lang.org.
47+
# For HTML this creates a relative link. For the man page it gives a direct
48+
# link to doc.rust-lang.org.
4949
#
5050
# Usage
5151
#
@@ -60,6 +60,7 @@ class LinkCargoInlineMacro < Extensions::InlineMacroProcessor
6060
def process parent, target, attrs
6161
text = attrs['text']
6262
if parent.document.basebackend? 'html'
63+
target = %(../#{target})
6364
parent.document.register :links, target
6465
%(#{(create_anchor parent, text, type: :link, target: target).render})
6566
elsif parent.document.backend == 'manpage'

src/doc/book.toml

+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
[book]
12
title = "The Cargo Book"
23
author = "Alex Crichton, Steve Klabnik and Carol Nichols, with Contributions from the Rust Community"
4+
5+
[output.html]
6+
git-repository-url = "https://github.com/rust-lang/cargo/tree/master/src/doc/src"

src/doc/man/generated/cargo-bench.html

+12-12
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ <h3 id="cargo_bench_package_selection">Package Selection</h3>
8080
<dt class="hdlist1"><strong>-p</strong> <em>SPEC</em>&#8230;&#8203;</dt>
8181
<dt class="hdlist1"><strong>--package</strong> <em>SPEC</em>&#8230;&#8203;</dt>
8282
<dd>
83-
<p>Benchmark only the specified packages. See <a href="commands/cargo-pkgid.html">cargo-pkgid(1)</a> for the
83+
<p>Benchmark only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
8484
SPEC format. This flag may be specified multiple times.</p>
8585
</dd>
8686
<dt class="hdlist1"><strong>--all</strong></dt>
@@ -230,7 +230,7 @@ <h3 id="cargo_bench_compilation_options">Compilation Options</h3>
230230
list of supported targets.</p>
231231
<div class="paragraph">
232232
<p>This may also be specified with the <code>build.target</code>
233-
<a href="reference/config.html">config value</a>.</p>
233+
<a href="../reference/config.html">config value</a>.</p>
234234
</div>
235235
</dd>
236236
</dl>
@@ -244,7 +244,7 @@ <h3 id="cargo_bench_output_options">Output Options</h3>
244244
<dd>
245245
<p>Directory for all generated artifacts and intermediate files. May also be
246246
specified with the <code>CARGO_TARGET_DIR</code> environment variable, or the
247-
<code>build.target-dir</code> <a href="reference/config.html">config value</a>. Defaults
247+
<code>build.target-dir</code> <a href="../reference/config.html">config value</a>. Defaults
248248
to <code>target</code> in the root of the workspace.</p>
249249
</dd>
250250
</dl>
@@ -270,7 +270,7 @@ <h3 id="cargo_bench_display_options">Display Options</h3>
270270
<p>Use verbose output. May be specified twice for "very verbose" output which
271271
includes extra output such as dependency warnings and build script output.
272272
May also be specified with the <code>term.verbose</code>
273-
<a href="reference/config.html">config value</a>.</p>
273+
<a href="../reference/config.html">config value</a>.</p>
274274
</dd>
275275
<dt class="hdlist1"><strong>-q</strong></dt>
276276
<dt class="hdlist1"><strong>--quiet</strong></dt>
@@ -296,7 +296,7 @@ <h3 id="cargo_bench_display_options">Display Options</h3>
296296
</div>
297297
<div class="paragraph">
298298
<p>May also be specified with the <code>term.color</code>
299-
<a href="reference/config.html">config value</a>.</p>
299+
<a href="../reference/config.html">config value</a>.</p>
300300
</div>
301301
</dd>
302302
<dt class="hdlist1"><strong>--message-format</strong> <em>FMT</em></dt>
@@ -351,11 +351,11 @@ <h3 id="cargo_bench_manifest_options">Manifest Options</h3>
351351
<p>Beware that this may result in different dependency resolution than online
352352
mode. Cargo will restrict itself to crates that are downloaded locally, even
353353
if there might be a newer version as indicated in the local copy of the index.
354-
See the <a href="commands/cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
354+
See the <a href="cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
355355
offline.</p>
356356
</div>
357357
<div class="paragraph">
358-
<p>May also be specified with the <code>net.offline</code> <a href="reference/config.html">config value</a>.</p>
358+
<p>May also be specified with the <code>net.offline</code> <a href="../reference/config.html">config value</a>.</p>
359359
</div>
360360
</dd>
361361
</dl>
@@ -391,7 +391,7 @@ <h3 id="cargo_bench_miscellaneous_options">Miscellaneous Options</h3>
391391
<dt class="hdlist1"><strong>--jobs</strong> <em>N</em></dt>
392392
<dd>
393393
<p>Number of parallel jobs to run. May also be specified with the
394-
<code>build.jobs</code> <a href="reference/config.html">config value</a>. Defaults to
394+
<code>build.jobs</code> <a href="../reference/config.html">config value</a>. Defaults to
395395
the number of CPUs.</p>
396396
</dd>
397397
</dl>
@@ -405,7 +405,7 @@ <h2 id="cargo_bench_profiles">PROFILES</h2>
405405
<div class="paragraph">
406406
<p>Profiles may be used to configure compiler options such as optimization levels
407407
and debug settings. See
408-
<a href="reference/manifest.html#the-profile-sections">the reference</a>
408+
<a href="../reference/manifest.html#the-profile-sections">the reference</a>
409409
for more details.</p>
410410
</div>
411411
<div class="paragraph">
@@ -416,7 +416,7 @@ <h2 id="cargo_bench_profiles">PROFILES</h2>
416416
</div>
417417
<div class="paragraph">
418418
<p>If you need a debug build of a benchmark, try building it with
419-
<a href="commands/cargo-build.html">cargo-build(1)</a> which will use the <code>test</code> profile which is by default
419+
<a href="cargo-build.html">cargo-build(1)</a> which will use the <code>test</code> profile which is by default
420420
unoptimized and includes debug information. You can then run the debug-enabled
421421
benchmark manually.</p>
422422
</div>
@@ -426,7 +426,7 @@ <h2 id="cargo_bench_profiles">PROFILES</h2>
426426
<h2 id="cargo_bench_environment">ENVIRONMENT</h2>
427427
<div class="sectionbody">
428428
<div class="paragraph">
429-
<p>See <a href="reference/environment-variables.html">the reference</a> for
429+
<p>See <a href="../reference/environment-variables.html">the reference</a> for
430430
details on environment variables that Cargo reads.</p>
431431
</div>
432432
</div>
@@ -477,7 +477,7 @@ <h2 id="cargo_bench_examples">EXAMPLES</h2>
477477
<h2 id="cargo_bench_see_also">SEE ALSO</h2>
478478
<div class="sectionbody">
479479
<div class="paragraph">
480-
<p><a href="commands/index.html">cargo(1)</a>, <a href="commands/cargo-test.html">cargo-test(1)</a></p>
480+
<p><a href="index.html">cargo(1)</a>, <a href="cargo-test.html">cargo-test(1)</a></p>
481481
</div>
482482
</div>
483483
</div>

src/doc/man/generated/cargo-build.html

+11-11
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h3 id="cargo_build_package_selection">Package Selection</h3>
3636
<dt class="hdlist1"><strong>-p</strong> <em>SPEC</em>&#8230;&#8203;</dt>
3737
<dt class="hdlist1"><strong>--package</strong> <em>SPEC</em>&#8230;&#8203;</dt>
3838
<dd>
39-
<p>Build only the specified packages. See <a href="commands/cargo-pkgid.html">cargo-pkgid(1)</a> for the
39+
<p>Build only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
4040
SPEC format. This flag may be specified multiple times.</p>
4141
</dd>
4242
<dt class="hdlist1"><strong>--all</strong></dt>
@@ -159,7 +159,7 @@ <h3 id="cargo_build_compilation_options">Compilation Options</h3>
159159
list of supported targets.</p>
160160
<div class="paragraph">
161161
<p>This may also be specified with the <code>build.target</code>
162-
<a href="reference/config.html">config value</a>.</p>
162+
<a href="../reference/config.html">config value</a>.</p>
163163
</div>
164164
</dd>
165165
<dt class="hdlist1"><strong>--release</strong></dt>
@@ -178,7 +178,7 @@ <h3 id="cargo_build_output_options">Output Options</h3>
178178
<dd>
179179
<p>Directory for all generated artifacts and intermediate files. May also be
180180
specified with the <code>CARGO_TARGET_DIR</code> environment variable, or the
181-
<code>build.target-dir</code> <a href="reference/config.html">config value</a>. Defaults
181+
<code>build.target-dir</code> <a href="../reference/config.html">config value</a>. Defaults
182182
to <code>target</code> in the root of the workspace.</p>
183183
</dd>
184184
<dt class="hdlist1"><strong>--out-dir</strong> <em>DIRECTORY</em></dt>
@@ -204,7 +204,7 @@ <h3 id="cargo_build_display_options">Display Options</h3>
204204
<p>Use verbose output. May be specified twice for "very verbose" output which
205205
includes extra output such as dependency warnings and build script output.
206206
May also be specified with the <code>term.verbose</code>
207-
<a href="reference/config.html">config value</a>.</p>
207+
<a href="../reference/config.html">config value</a>.</p>
208208
</dd>
209209
<dt class="hdlist1"><strong>-q</strong></dt>
210210
<dt class="hdlist1"><strong>--quiet</strong></dt>
@@ -230,7 +230,7 @@ <h3 id="cargo_build_display_options">Display Options</h3>
230230
</div>
231231
<div class="paragraph">
232232
<p>May also be specified with the <code>term.color</code>
233-
<a href="reference/config.html">config value</a>.</p>
233+
<a href="../reference/config.html">config value</a>.</p>
234234
</div>
235235
</dd>
236236
<dt class="hdlist1"><strong>--message-format</strong> <em>FMT</em></dt>
@@ -296,11 +296,11 @@ <h3 id="cargo_build_manifest_options">Manifest Options</h3>
296296
<p>Beware that this may result in different dependency resolution than online
297297
mode. Cargo will restrict itself to crates that are downloaded locally, even
298298
if there might be a newer version as indicated in the local copy of the index.
299-
See the <a href="commands/cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
299+
See the <a href="cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
300300
offline.</p>
301301
</div>
302302
<div class="paragraph">
303-
<p>May also be specified with the <code>net.offline</code> <a href="reference/config.html">config value</a>.</p>
303+
<p>May also be specified with the <code>net.offline</code> <a href="../reference/config.html">config value</a>.</p>
304304
</div>
305305
</dd>
306306
</dl>
@@ -331,7 +331,7 @@ <h3 id="cargo_build_miscellaneous_options">Miscellaneous Options</h3>
331331
<dt class="hdlist1"><strong>--jobs</strong> <em>N</em></dt>
332332
<dd>
333333
<p>Number of parallel jobs to run. May also be specified with the
334-
<code>build.jobs</code> <a href="reference/config.html">config value</a>. Defaults to
334+
<code>build.jobs</code> <a href="../reference/config.html">config value</a>. Defaults to
335335
the number of CPUs.</p>
336336
</dd>
337337
</dl>
@@ -345,7 +345,7 @@ <h2 id="cargo_build_profiles">PROFILES</h2>
345345
<div class="paragraph">
346346
<p>Profiles may be used to configure compiler options such as optimization levels
347347
and debug settings. See
348-
<a href="reference/manifest.html#the-profile-sections">the reference</a>
348+
<a href="../reference/manifest.html#the-profile-sections">the reference</a>
349349
for more details.</p>
350350
</div>
351351
<div class="paragraph">
@@ -389,7 +389,7 @@ <h2 id="cargo_build_profiles">PROFILES</h2>
389389
<h2 id="cargo_build_environment">ENVIRONMENT</h2>
390390
<div class="sectionbody">
391391
<div class="paragraph">
392-
<p>See <a href="reference/environment-variables.html">the reference</a> for
392+
<p>See <a href="../reference/environment-variables.html">the reference</a> for
393393
details on environment variables that Cargo reads.</p>
394394
</div>
395395
</div>
@@ -440,7 +440,7 @@ <h2 id="cargo_build_examples">EXAMPLES</h2>
440440
<h2 id="cargo_build_see_also">SEE ALSO</h2>
441441
<div class="sectionbody">
442442
<div class="paragraph">
443-
<p><a href="commands/index.html">cargo(1)</a>, <a href="commands/cargo-rustc.html">cargo-rustc(1)</a></p>
443+
<p><a href="index.html">cargo(1)</a>, <a href="cargo-rustc.html">cargo-rustc(1)</a></p>
444444
</div>
445445
</div>
446446
</div>

src/doc/man/generated/cargo-check.html

+11-11
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h3 id="cargo_check_package_selection">Package Selection</h3>
4040
<dt class="hdlist1"><strong>-p</strong> <em>SPEC</em>&#8230;&#8203;</dt>
4141
<dt class="hdlist1"><strong>--package</strong> <em>SPEC</em>&#8230;&#8203;</dt>
4242
<dd>
43-
<p>Check only the specified packages. See <a href="commands/cargo-pkgid.html">cargo-pkgid(1)</a> for the
43+
<p>Check only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
4444
SPEC format. This flag may be specified multiple times.</p>
4545
</dd>
4646
<dt class="hdlist1"><strong>--all</strong></dt>
@@ -163,7 +163,7 @@ <h3 id="cargo_check_compilation_options">Compilation Options</h3>
163163
list of supported targets.</p>
164164
<div class="paragraph">
165165
<p>This may also be specified with the <code>build.target</code>
166-
<a href="reference/config.html">config value</a>.</p>
166+
<a href="../reference/config.html">config value</a>.</p>
167167
</div>
168168
</dd>
169169
<dt class="hdlist1"><strong>--release</strong></dt>
@@ -190,7 +190,7 @@ <h3 id="cargo_check_output_options">Output Options</h3>
190190
<dd>
191191
<p>Directory for all generated artifacts and intermediate files. May also be
192192
specified with the <code>CARGO_TARGET_DIR</code> environment variable, or the
193-
<code>build.target-dir</code> <a href="reference/config.html">config value</a>. Defaults
193+
<code>build.target-dir</code> <a href="../reference/config.html">config value</a>. Defaults
194194
to <code>target</code> in the root of the workspace.</p>
195195
</dd>
196196
</dl>
@@ -206,7 +206,7 @@ <h3 id="cargo_check_display_options">Display Options</h3>
206206
<p>Use verbose output. May be specified twice for "very verbose" output which
207207
includes extra output such as dependency warnings and build script output.
208208
May also be specified with the <code>term.verbose</code>
209-
<a href="reference/config.html">config value</a>.</p>
209+
<a href="../reference/config.html">config value</a>.</p>
210210
</dd>
211211
<dt class="hdlist1"><strong>-q</strong></dt>
212212
<dt class="hdlist1"><strong>--quiet</strong></dt>
@@ -232,7 +232,7 @@ <h3 id="cargo_check_display_options">Display Options</h3>
232232
</div>
233233
<div class="paragraph">
234234
<p>May also be specified with the <code>term.color</code>
235-
<a href="reference/config.html">config value</a>.</p>
235+
<a href="../reference/config.html">config value</a>.</p>
236236
</div>
237237
</dd>
238238
<dt class="hdlist1"><strong>--message-format</strong> <em>FMT</em></dt>
@@ -287,11 +287,11 @@ <h3 id="cargo_check_manifest_options">Manifest Options</h3>
287287
<p>Beware that this may result in different dependency resolution than online
288288
mode. Cargo will restrict itself to crates that are downloaded locally, even
289289
if there might be a newer version as indicated in the local copy of the index.
290-
See the <a href="commands/cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
290+
See the <a href="cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
291291
offline.</p>
292292
</div>
293293
<div class="paragraph">
294-
<p>May also be specified with the <code>net.offline</code> <a href="reference/config.html">config value</a>.</p>
294+
<p>May also be specified with the <code>net.offline</code> <a href="../reference/config.html">config value</a>.</p>
295295
</div>
296296
</dd>
297297
</dl>
@@ -322,7 +322,7 @@ <h3 id="cargo_check_miscellaneous_options">Miscellaneous Options</h3>
322322
<dt class="hdlist1"><strong>--jobs</strong> <em>N</em></dt>
323323
<dd>
324324
<p>Number of parallel jobs to run. May also be specified with the
325-
<code>build.jobs</code> <a href="reference/config.html">config value</a>. Defaults to
325+
<code>build.jobs</code> <a href="../reference/config.html">config value</a>. Defaults to
326326
the number of CPUs.</p>
327327
</dd>
328328
</dl>
@@ -336,7 +336,7 @@ <h2 id="cargo_check_profiles">PROFILES</h2>
336336
<div class="paragraph">
337337
<p>Profiles may be used to configure compiler options such as optimization levels
338338
and debug settings. See
339-
<a href="reference/manifest.html#the-profile-sections">the reference</a>
339+
<a href="../reference/manifest.html#the-profile-sections">the reference</a>
340340
for more details.</p>
341341
</div>
342342
<div class="paragraph">
@@ -380,7 +380,7 @@ <h2 id="cargo_check_profiles">PROFILES</h2>
380380
<h2 id="cargo_check_environment">ENVIRONMENT</h2>
381381
<div class="sectionbody">
382382
<div class="paragraph">
383-
<p>See <a href="reference/environment-variables.html">the reference</a> for
383+
<p>See <a href="../reference/environment-variables.html">the reference</a> for
384384
details on environment variables that Cargo reads.</p>
385385
</div>
386386
</div>
@@ -431,7 +431,7 @@ <h2 id="cargo_check_examples">EXAMPLES</h2>
431431
<h2 id="cargo_check_see_also">SEE ALSO</h2>
432432
<div class="sectionbody">
433433
<div class="paragraph">
434-
<p><a href="commands/index.html">cargo(1)</a>, <a href="commands/cargo-build.html">cargo-build(1)</a></p>
434+
<p><a href="index.html">cargo(1)</a>, <a href="cargo-build.html">cargo-build(1)</a></p>
435435
</div>
436436
</div>
437437
</div>

0 commit comments

Comments
 (0)