Skip to content

Commit 4fd7076

Browse files
committed
Don't recommend setting html_root_url
1 parent 91939a7 commit 4fd7076

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

src/checklist.md

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
- [ ] Cargo.toml includes all common metadata ([C-METADATA])
3737
- authors, description, license, homepage, documentation, repository,
3838
readme, keywords, categories
39-
- [ ] Crate sets html_root_url attribute "https://docs.rs/CRATE/X.Y.Z" ([C-HTML-ROOT])
4039
- [ ] Release notes document all significant changes ([C-RELNOTES])
4140
- [ ] Rustdoc does not show unhelpful implementation details ([C-HIDDEN])
4241
- **Predictability** *(crate enables legible code that acts how it looks)*

src/documentation.md

-45
Original file line numberDiff line numberDiff line change
@@ -202,51 +202,6 @@ crate other than the source repository or API documentation. Do not make
202202
`homepage` redundant with either the `documentation` or `repository` values. For
203203
example, serde sets `homepage` to *https://serde.rs*, a dedicated website.
204204

205-
[C-HTML-ROOT]: #c-html-root
206-
<a id="c-html-root"></a>
207-
### Crate sets html_root_url attribute (C-HTML-ROOT)
208-
209-
<!--
210-
Remove this guideline once rustdoc links no-deps documentation with no
211-
html_root_url to docs.rs by default.
212-
https://github.com/rust-lang/rust/issues/42301
213-
-->
214-
215-
It should point to `"https://docs.rs/CRATE/MAJOR.MINOR.PATCH"`,
216-
assuming the crate uses docs.rs for its primary API documentation.
217-
218-
The `html_root_url` attribute tells rustdoc how to create URLs to
219-
items in the crate when compiling downstream crates. Without it, links
220-
in the documentation of crates that depend on your crate will be
221-
incorrect.
222-
223-
```rust
224-
#![doc(html_root_url = "https://docs.rs/log/0.3.8")]
225-
```
226-
227-
Because this URL contains an exact version number, it must be kept in
228-
sync with the version number in `Cargo.toml`. The [`version-sync`]
229-
crate can help with this by letting you add an integration test that
230-
fails if the `html_root_url` version number is out of sync with the
231-
crate version.
232-
233-
[`version-sync`]: https://crates.io/crates/version-sync
234-
235-
If you do not like that mechanism, it is recommended to add a comment
236-
to the `Cargo.toml` version key reminding yourself to keep the two
237-
updated together, like:
238-
239-
```toml
240-
version = "0.3.8" # remember to update html_root_url
241-
```
242-
243-
For documentation hosted outside of docs.rs, the value for `html_root_url` is
244-
correct if appending the crate name + index.html takes you to the documentation
245-
of the crate's root module. For example if the documentation of the root module
246-
is located at `"https://api.rocket.rs/rocket/index.html"` then the
247-
`html_root_url` would be `"https://api.rocket.rs"`.
248-
249-
250205
<a id="c-relnotes"></a>
251206
## Release notes document all significant changes (C-RELNOTES)
252207

0 commit comments

Comments
 (0)