Skip to content

Commit 50cfb87

Browse files
committed
Anchor internal links to the root of the book & Update README.md
1 parent 9c48d95 commit 50cfb87

File tree

17 files changed

+30
-30
lines changed

17 files changed

+30
-30
lines changed

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,31 @@ $ cargo install mdbook
2929

3030
### Building
3131

32-
To build the book, do this:
33-
32+
The most straight-forward way to build and view the book locally is to use the following command:
3433
```bash
35-
$ mdbook build
34+
$ mdbook serve
3635
```
3736

38-
The output will be in the `book` subdirectory. To check it out, open it in
39-
your web browser.
37+
This serves the book at http://localhost:3000, and rebuilds it on changes.
38+
You can now view the book in your web browser. If you make changes to the book's source code,
39+
you should only need to refresh your browser to see them.
4040

4141
_Firefox:_
4242

4343
```shell
44-
$ firefox book/index.html # Linux
45-
$ open -a "Firefox" book/index.html # OS X
46-
$ Start-Process "firefox.exe" .\book\index.html # Windows (PowerShell)
47-
$ start firefox.exe .\book\index.html # Windows (Cmd)
44+
$ firefox http://localhost:3000 # Linux
45+
$ open -a "Firefox" http://localhost:3000 # OS X
46+
$ Start-Process "firefox.exe" http://localhost:3000 # Windows (PowerShell)
47+
$ start firefox.exe http://localhost:3000 # Windows (Cmd)
4848
```
4949

5050
_Chrome:_
5151

5252
```shell
53-
$ google-chrome book/index.html # Linux
54-
$ open -a "Google Chrome" book/index.html # OS X
55-
$ Start-Process "chrome.exe" .\book\index.html # Windows (PowerShell)
56-
$ start chrome.exe .\book\index.html # Windows (Cmd)
53+
$ google-chrome http://localhost:3000 # Linux
54+
$ open -a "Google Chrome" http://localhost:3000 # OS X
55+
$ Start-Process "chrome.exe" http://localhost:3000 # Windows (PowerShell)
56+
$ start chrome.exe http://localhost:3000 # Windows (Cmd)
5757
```
5858

5959
To run the tests:

src/editions/transitioning-an-existing-project-to-a-new-edition.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ trait Foo {
2121
```
2222

2323
This code uses an anonymous parameter, that `Box<Foo>`. This is [not
24-
supported in Rust 2018](rust-2018/trait-system/no-anon-params.html), and
24+
supported in Rust 2018](/rust-2018/trait-system/no-anon-params.html), and
2525
so this would fail to compile. Let's get this code up to date!
2626

2727
## Updating your code to be compatible with the new edition
@@ -89,7 +89,7 @@ trait Foo {
8989
```
9090

9191
In Rust 2018, it's considered idiomatic to use the [`dyn`
92-
keyword](rust-2018/trait-system/dyn-trait-for-trait-objects.html) for
92+
keyword](/rust-2018/trait-system/dyn-trait-for-trait-objects.html) for
9393
trait objects.
9494

9595
Eventually, we want `cargo fix` to fix all these idioms automatically in the same
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Cargo and crates.io
22

3-
[check]: rust-2018/cargo-and-crates-io/cargo-check-for-faster-checking.html
3+
[check]: /rust-2018/cargo-and-crates-io/cargo-check-for-faster-checking.html
44

55
In this chapter of the guide, we discuss a few improvements to `cargo` and crates.io.
66
A notable addition here is the new [`cargo check`][check] command.

src/rust-2018/control-flow/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Control flow
22

3-
[async_await]: rust-2018/control-flow/async-await-for-easier-concurrency.html
3+
[async_await]: /rust-2018/control-flow/async-await-for-easier-concurrency.html
44

55
In this chapter of the guide, we discuss a few improvements to control flow.
66
The most notable of these *will* be [`async` and `await`][async_await].

src/rust-2018/data-types/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Data types
22

3-
[fis]: rust-2018/data-types/field-init-shorthand.html
3+
[fis]: /rust-2018/data-types/field-init-shorthand.html
44

55
In this chapter of the guide, we discuss a few improvements to data types.
66
One of these are [field-init-shorthand][fis].

src/rust-2018/documentation/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Documentation
22

3-
[sec_ed]: rust-2018/documentation/new-editions-of-the-book.html
3+
[sec_ed]: /rust-2018/documentation/new-editions-of-the-book.html
44

55
In this chapter of the guide, we discuss a few improvements to documentation.
66
A notable addition here is the [second edition of "the book"][sec_ed].
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Error handling and Panics
22

3-
[qop]: rust-2018/error-handling-and-panics/the-question-mark-operator-for-easier-error-handling.html
3+
[qop]: /rust-2018/error-handling-and-panics/the-question-mark-operator-for-easier-error-handling.html
44

55
In this chapter of the guide, we discuss a few improvements to error handling
66
in Rust. The most notable of these is [the introduction of the `?` operator][qop].

src/rust-2018/macros/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Macros
22

3-
[custom-derive]: rust-2018/macros/custom-derive.html
3+
[custom-derive]: /rust-2018/macros/custom-derive.html
44

55
In this chapter of the guide, we discuss a few improvements to the macro system.
66
A notable addition here is the introduction of [custom derive macros][custom-derive].

src/rust-2018/module-system/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Module system
22

3-
[path clarity changes]: rust-2018/module-system/path-clarity.html
3+
[path clarity changes]: /rust-2018/module-system/path-clarity.html
44

55
In this chapter of the guide, we discuss a few changes to the module system.
66
The most notable of these are the [path clarity changes].

src/rust-2018/module-system/path-clarity.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Finally, on nightly, you'll need it for crates like:
9393
#### Macros
9494

9595
One other use for `extern crate` was to import macros; that's no longer needed.
96-
Check [the macro section](rust-2018/macros/macro-changes.html) for more.
96+
Check [the macro section](/rust-2018/macros/macro-changes.html) for more.
9797

9898
If you've been using `as` to rename your crate like this:
9999

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ownership and lifetimes
22

3-
[dmbm]: rust-2018/ownership-and-lifetimes/default-match-bindings.html
3+
[dmbm]: /rust-2018/ownership-and-lifetimes/default-match-bindings.html
44

55
In this chapter of the guide, we discuss a few improvements to ownership and lifetimes.
66
One of the most notable of these is [default match binding modes][dmbm].

src/rust-2018/ownership-and-lifetimes/lifetime-elision-in-impl.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ impl<T> Drop for SetOnDrop<'_, T> {
7272
}
7373
```
7474

75-
[the anonymous lifetime]: rust-2018/ownership-and-lifetimes/the-anonymous-lifetime.html
75+
[the anonymous lifetime]: /rust-2018/ownership-and-lifetimes/the-anonymous-lifetime.html
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Platform and target support
22

3-
[libcore]: rust-2018/platform-and-target-support/libcore-for-low-level-rust.html
3+
[libcore]: /rust-2018/platform-and-target-support/libcore-for-low-level-rust.html
44

55
In this chapter of the guide, we discuss a few improvements to platform and target support.
66
A notable addition to it was [that the `libcore` library now works on stable Rust][libcore].

src/rust-2018/rustdoc/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `rustdoc`
22

3-
[cf]: rust-2018/rustdoc/documentation-tests-can-now-compile-fail.html
3+
[cf]: /rust-2018/rustdoc/documentation-tests-can-now-compile-fail.html
44

55
In this chapter of the guide, we discuss a few improvements to `rustdoc`.
66
A notable addition to it was [that documentation tests can now compile-fail][cf].

src/rust-2018/the-compiler/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The compiler
22

3-
[errors]: rust-2018/the-compiler/improved-error-messages.html
3+
[errors]: /rust-2018/the-compiler/improved-error-messages.html
44

55
In this chapter of the guide, we discuss a few improvements to the compiler.
66
A notable addition here is our new and [improved error messages][errors].

src/rust-2018/trait-system/dyn-trait-for-trait-objects.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ is sometimes slower, and often cannot be used at all when its alternatives can.
3636

3737
Furthermore, with `impl Trait` arriving, "`impl Trait` vs `dyn Trait`" is much
3838
more symmetric, and therefore a bit nicer, than "`impl Trait` vs `Trait`".
39-
`impl Trait` is explained [here](rust-2018/trait-system/impl-trait-for-returning-complex-types-with-ease.html)
39+
`impl Trait` is explained [here](/rust-2018/trait-system/impl-trait-for-returning-complex-types-with-ease.html)
4040

4141
In the new edition, you should therefore prefer `dyn Trait` to just `Trait`
4242
where you need a trait object.

src/rust-2018/trait-system/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Trait system
22

3-
[impl_trait]: rust-2018/trait-system/impl-trait-for-returning-complex-types-with-ease.html
3+
[impl_trait]: /rust-2018/trait-system/impl-trait-for-returning-complex-types-with-ease.html
44

55
In this chapter of the guide, we discuss a few improvements to the trait system.
66
The most notable of these is [`impl Trait`][impl_trait].

0 commit comments

Comments
 (0)