Skip to content

Commit c44b031

Browse files
committed
More directly document the SPEC_RELATIVE environment variable
1 parent 9165a56 commit c44b031

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,14 @@ SPEC_RELATIVE=0 mdbook build --open
6666

6767
This will open a browser with a websocket live-link to automatically reload whenever the source is updated.
6868

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-
7169
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:
7270

7371
```sh
7472
SPEC_RELATIVE=0 mdbook serve --open
7573
```
74+
75+
### `SPEC_RELATIVE`
76+
77+
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.
78+
79+
The published site at <https://doc.rust-lang.org/reference/> (or local docs using `rustup doc`) does not set this, which means it will use relative links which supports offline viewing and links to the correct version (for example, links in <https://doc.rust-lang.org/1.81.0/reference/> will stay within the 1.81.0 directory).

0 commit comments

Comments
 (0)