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.
This commit is contained in:
Martin Geisler 2017-09-23 12:48:23 +02:00
parent e09c248fc1
commit e67a061bcf
2 changed files with 6 additions and 0 deletions

View file

@ -511,6 +511,7 @@
//! this repository for more information. //! this repository for more information.
#![crate_type= "lib"] #![crate_type= "lib"]
#![doc(html_root_url = "https://docs.rs/clap/2.26.2")]
#![deny( #![deny(
missing_docs, missing_docs,
missing_debug_implementations, missing_debug_implementations,

View file

@ -5,3 +5,8 @@ extern crate version_sync;
fn test_readme_deps() { fn test_readme_deps() {
assert_markdown_deps_updated!("README.md"); assert_markdown_deps_updated!("README.md");
} }
#[test]
fn test_html_root_url() {
assert_html_root_url_updated!("src/lib.rs");
}