Skip to content

Commit

Permalink
docs: add html_root_url attribute
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mgeisler committed Sep 23, 2017
1 parent e09c248 commit e67a061
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@
//! this repository for more information.

#![crate_type= "lib"]
#![doc(html_root_url = "https://docs.rs/clap/2.26.2")]
#![deny(
missing_docs,
missing_debug_implementations,
Expand Down
5 changes: 5 additions & 0 deletions tests/version-numbers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ extern crate version_sync;
fn test_readme_deps() {
assert_markdown_deps_updated!("README.md");
}

#[test]
fn test_html_root_url() {
assert_html_root_url_updated!("src/lib.rs");
}

0 comments on commit e67a061

Please sign in to comment.