Skip to content

Commit ac63584

Browse files
authored
Merge pull request #230 from jyn514/html-root-url
Don't recommend setting html_root_url
2 parents 62f82d1 + 4fd7076 commit ac63584

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
@@ -208,51 +208,6 @@ crate other than the source repository or API documentation. Do not make
208208
`homepage` redundant with either the `documentation` or `repository` values. For
209209
example, serde sets `homepage` to *https://serde.rs*, a dedicated website.
210210

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

0 commit comments

Comments
 (0)