-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rustdoc: Show the correct source filename in page titles, without .html
#78094
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Note that I haven't tested this locally yet, so this is draft. |
Previously the title would be lib.rs.html -- source if `lib.rs` was the actual source filename. Now the title is lib.rs – source (note the en dash).
5b8120d
to
83ec8c1
Compare
Tested locally: it works! |
src/librustdoc/html/sources.rs
Outdated
cur.file_name().expect("failed to get file name").to_string_lossy() | ||
); | ||
let desc = format!("Source to the Rust file `{}`.", filename); | ||
let title = format!("{} – source", src_fname,); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to just use a plain dash (-) rather than a Unicode en dash (–) since I think that's what other page titles use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to use -
for now so it's consistent; if you want to use –
then let's make a separate PR making all of the pages use –
at once.
r? @jyn514 I would suggest avoiding unrelated cleanups in PRs like this (i.e., the second commit here). |
.html
.html
src/librustdoc/html/sources.rs
Outdated
cur.file_name().expect("failed to get file name").to_string_lossy() | ||
); | ||
let desc = format!("Source to the Rust file `{}`.", filename); | ||
let title = format!("{} – source", src_fname,); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to use -
for now so it's consistent; if you want to use –
then let's make a separate PR making all of the pages use –
at once.
Sorry about that! I guess it feels like too much overhead to open a lot of PRs each doing a small thing, but I agree that it makes sense to split them up in the future. |
83ec8c1
to
243c8e9
Compare
@bors r+ rollup Good catch, thanks :) |
📌 Commit 243c8e9 has been approved by |
…=jyn514 rustdoc: Show the correct source filename in page titles, without `.html` Previously the title would be lib.rs.html -- source if `lib.rs` was the actual source filename. Now the title is lib.rs - source
Rollup of 7 pull requests Successful merges: - rust-lang#77726 (Add Pin::static_ref, static_mut.) - rust-lang#78002 (Tweak "object unsafe" errors) - rust-lang#78056 (BTreeMap: split off most code of remove and split_off) - rust-lang#78063 (Improve wording of "cannot multiply" type error) - rust-lang#78094 (rustdoc: Show the correct source filename in page titles, without `.html`) - rust-lang#78101 (fix static_ptr_ty for foreign statics) - rust-lang#78118 (Inline const followups) Failed merges: r? `@ghost`
Clean up lib docs Cherry-picked out of rust-lang#78094.
Previously the title would be
if
lib.rs
was the actual source filename. Now the title is