Skip to content

Steps for checking that your html_root_url is correct #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dtolnay opened this issue May 29, 2017 · 4 comments
Closed

Steps for checking that your html_root_url is correct #77

dtolnay opened this issue May 29, 2017 · 4 comments

Comments

@dtolnay
Copy link
Member

dtolnay commented May 29, 2017

Hyper has been using a bad html_root_url since 0.10.7 (hyperium/hyper#1193). Let's explain or link to an explanation of how to pick the right html_root_url so users are not forced to guess.

@seanmonstar
Copy link

I would much rather this somehow be automated in Cargo or something, maybe via env!("CARGO_PKG_VERSION") or something.

@dtolnay
Copy link
Member Author

dtolnay commented May 29, 2017

Yes keeping the version updated automatically would be great! That would solve the problem of an outdated version in html_root_url like tokio-rs/mio#613.

I don't think it would solve hyperium/hyper@aee7c99 and similar. Rustdoc urls have a tendency to be confusing. Which of these is the right html_root_url?

  • https://hyperium.github.io/hyper/hyper/index.html
  • https://hyperium.github.io/hyper/hyper/
  • https://hyperium.github.io/hyper/hyper
  • https://hyperium.github.io/hyper/
  • https://hyperium.github.io/hyper
  • https://hyperium.github.io/
  • https://hyperium.github.io

Let's check the book.

You can control a few aspects of the HTML that rustdoc generates through the #![doc] version of the attribute:

#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
       html_favicon_url = "https://www.rust-lang.org/favicon.ico",
       html_root_url = "https://doc.rust-lang.org/")]

This sets a few different options, with a logo, favicon, and a root URL.

😿

@dtolnay
Copy link
Member Author

dtolnay commented May 29, 2017

The html_root_url attribute is not (yet?) mentioned in the second edition of the book so for now we will need to provide more explanation here than we may like. rust-lang/book#725

@dtolnay
Copy link
Member Author

dtolnay commented Oct 29, 2017

We removed the html_root_url recommendation.

@dtolnay dtolnay closed this as completed Oct 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants