Skip to content

Commit e67a061

Browse files
committed
docs: add html_root_url attribute
This doc attribute is used by rustdoc when generating documentation for other crates that depend on this crate. With the html_root_url, rustdoc will be able to generate correct links into this crate. See C-HTML-ROOT in the Rust API Guidelines for more information: https://rust-lang-nursery.github.io/api-guidelines/documentation.html#crate-sets-html_root_url-attribute-c-html-root A version-sync check was added to ensure that the URL is kept up to date when the crate version changes.
1 parent e09c248 commit e67a061

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@
511511
//! this repository for more information.
512512
513513
#![crate_type= "lib"]
514+
#![doc(html_root_url = "https://docs.rs/clap/2.26.2")]
514515
#![deny(
515516
missing_docs,
516517
missing_debug_implementations,

tests/version-numbers.rs

+5
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ extern crate version_sync;
55
fn test_readme_deps() {
66
assert_markdown_deps_updated!("README.md");
77
}
8+
9+
#[test]
10+
fn test_html_root_url() {
11+
assert_html_root_url_updated!("src/lib.rs");
12+
}

0 commit comments

Comments
 (0)