You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also install `mdbook-spec` which is a preprocessor which adds some Markdown extensions:
34
-
35
-
```sh
36
-
cargo install --locked mdbook-spec
37
-
```
38
-
39
32
## Building
40
33
41
34
To build the Reference, first clone the project:
@@ -68,15 +61,15 @@ To build the Reference locally (in `build/`) and open it in a web
68
61
browser, run:
69
62
70
63
```sh
71
-
mdbook build --open
64
+
SPEC_RELATIVE=0 mdbook build --open
72
65
```
73
66
74
67
This will open a browser with a websocket live-link to automatically reload whenever the source is updated.
75
68
76
-
You can also open any current build of the reference by running:
69
+
The `SPEC_RELATIVE=0` environment variable makes links to the standard library go to <https://doc.rust-lang.org/> instead of being relative, which is useful when viewing locally since you normally don't have a copy of the standard library.
70
+
71
+
You can also use mdbook's live webserver option, which will automatically rebuild the book and reload your web browser whenever a source file is modified:
Copy file name to clipboardExpand all lines: docs/authoring.md
+10-1
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,15 @@ Explicit namespace disambiguation is also supported:
109
109
[`std::vec`](mod@std::vec)
110
110
```
111
111
112
+
Beware there are some limitations, for example:
113
+
114
+
- Links to rexports from `std_arch` don't work due to <https://github.com/rust-lang/rust/issues/96506>.
115
+
- Links to keywords aren't supported.
116
+
- Links to trait impls where the trait is not in the prelude doesn't work. Traits must be in scope, and there currently isn't a way to add those.
117
+
- If there are multiple generic implementations, it will link to one randomly (see <https://github.com/rust-lang/rust/issues/76895>).
118
+
119
+
When running into a rustdoc limitation, consider manually linking to the correct page using a relative link. For example, `../std/arch/macro.is_x86_feature_detected.html`.
@@ -145,4 +154,4 @@ The reference does not document which targets exist, or the properties of specif
145
154
146
155
### Editions
147
156
148
-
The main text and flow should document only the current edition. Whenever there is a difference between editions, the differences should be called out with an "Edition Differences" block.
157
+
The main text and flow should document only the current edition. Whenever there is a difference between editions, the differences should be called out with an "Edition differences" block.
0 commit comments