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
Improve contributor experience for the dev-guide itself (#973)
- Fix typos in the README
- Don't echo all instructions in the linkcheck.sh shellscript; this is
noisy and unhelpful when developing locally. Verbose output is still
enabled in CI.
- Link to the index page for compiler docs, not `rustc_middle`. Note
that the compiler docs are not a guide - that's us!
- Remove outdated instructions about avoiding 429s. These should no
longer be occurring locally now that we're using caching.
- Consolidate info about `mdbook` and `mdbook-linkcheck` near each other
These validations can cause errors during local builds (see Link Validations section below). Please **do not** commit these `book.toml` file changes when you submit a pull request.
64
-
65
40
To build a local static HTML site, install [`mdbook`](https://github.com/rust-lang/mdBook) with:
66
41
67
42
```
68
-
> cargo install mdbook
43
+
> cargo install mdbook mdbook-linkcheck
69
44
```
70
45
71
46
and execute the following command in the root of the repository:
@@ -76,6 +51,11 @@ and execute the following command in the root of the repository:
76
51
77
52
The build files are found in the `book` directory.
78
53
54
+
### Link Validations
55
+
56
+
We use `mdbook-linkcheck` to validate URLs included in our documentation.
57
+
`linkcheck` will be run automatically when you build with the instructions in the section above.
58
+
79
59
### Pre-commit script
80
60
81
61
We also test that line lengths are less than 100 columns. To test this locally,
We use `mdbook-linkcheck` to validate URLs included in our documentation. To perform link checks, uncomment the `[output.linkcheck]` field in the `book.toml` configuration file and install `mdbook-linkcheck` with:
101
-
102
-
```bash
103
-
> cargo install mdbook-linkcheck
104
-
```
105
-
106
-
You will need recent versions of `mdbook` and `mdbook-linkcheck` to check links.
107
-
`linkcheck` will be run automatically when you build with the instructions in the section above.
108
-
109
-
**Please note**: You may receive errors like the following when link-checking is enabled on local `mdbook` builds:
110
-
111
-
```
112
-
error: The server responded with 429 Too Many Requests for "https://github.com/rust-lang/rust/tree/master/src/tools/compiletest"
113
-
114
-
┌── tests/intro.md:6:1 ───
115
-
│
116
-
6 │ [`src/tools/compiletest`] directory). This section gives a brief
117
-
│ ^ Server responded with 429 Too Many Requests
118
-
```
119
-
120
-
There is not a workaround for this error at the moment. Comment out the `[output.linkcheck]` field in the `book.toml` using the build instructions above to complete a local site build without link validations.
121
-
122
-
123
78
## How to fix toolstate failures
124
79
125
80
> **NOTE**: Currently, we do not track the rustc-dev-guide toolstate due to
but we leave these instructions for when we do it again in the future.
128
83
129
84
1. You will get a ping from the toolstate commit. e.g. https://github.com/rust-lang-nursery/rust-toolstate/commit/8ffa0e4c30ac9ba8546b7046e5c4ccc2b96ebdd4
0 commit comments