Skip to content
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

Merged
merged 2 commits into from
Oct 21, 2020

Conversation

camelid
Copy link
Member

@camelid camelid commented Oct 19, 2020

Previously the title would be

lib.rs.html -- source

if lib.rs was the actual source filename. Now the title is

lib.rs - source

@camelid camelid added C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 19, 2020
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 19, 2020
@camelid
Copy link
Member Author

camelid commented Oct 19, 2020

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).
@camelid
Copy link
Member Author

camelid commented Oct 19, 2020

Tested locally: it works!

@camelid camelid marked this pull request as ready for review October 19, 2020 03:46
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,);
Copy link
Member Author

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.

Copy link
Member

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.

@Mark-Simulacrum
Copy link
Member

r? @jyn514

I would suggest avoiding unrelated cleanups in PRs like this (i.e., the second commit here).

@jyn514 jyn514 changed the title rustdoc: Show the correct source filename, without .html rustdoc: Show the correct source filename in page titles, without .html Oct 20, 2020
src/librustdoc/html/sources.rs Outdated Show resolved Hide resolved
src/librustdoc/html/sources.rs Outdated Show resolved Hide resolved
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,);
Copy link
Member

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.

library/alloc/src/string.rs Outdated Show resolved Hide resolved
@camelid
Copy link
Member Author

camelid commented Oct 20, 2020

I would suggest avoiding unrelated cleanups in PRs like this (i.e., the second commit here).

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.

@jyn514
Copy link
Member

jyn514 commented Oct 20, 2020

@bors r+ rollup

Good catch, thanks :)

@bors
Copy link
Contributor

bors commented Oct 20, 2020

📌 Commit 243c8e9 has been approved by jyn514

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 20, 2020
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Oct 21, 2020
…=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
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 21, 2020
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`
@bors bors merged commit 72ae00b into rust-lang:master Oct 21, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 21, 2020
@camelid camelid deleted the rustdoc-fix-source-title branch October 21, 2020 18:50
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants