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: Allow customizing the crate list sidebar. #16328

Open
SimonSapin opened this issue Aug 7, 2014 · 9 comments
Open

rustdoc: Allow customizing the crate list sidebar. #16328

SimonSapin opened this issue Aug 7, 2014 · 9 comments
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Comments

@SimonSapin
Copy link
Contributor

http://doc.servo.org/servo/index.html is the rustdoc documentation for Servo’s own crates, those of all dependencies (submodules), and Rust’s (for the version used by Servo, which is usually a few weeks behind Rust master.)

Currently, this is a total of 69 crates that are listed in alphabetical order. Instead, I would like the sidebar to have three sub-sections (Servo, submodules, and Rust) each listing the corresponding crates. The sidebar is generated by a copy of src/librustdoc/html/static/main.js, and therefore is not easy to customize.

Could rustdoc help with this? Perhaps, rather than adding a feature for exactly what Servo wants, enable arbitrary behavior by providing a hook for overriding the bit of JS that generates the sidebar?

@thehydroimpulse
Copy link
Contributor

I'm thinking the best way would be a configuration file of some sort. Like a doc.json which could customize these things without passing a ton of flags to rustdoc.

This could also be a solution to adding other stylesheets to customize the styles and such.

@steveklabnik steveklabnik added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Sep 3, 2015
@steveklabnik
Copy link
Member

Triage: no change.

@steveklabnik
Copy link
Member

Triage: still no changes.

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@steveklabnik
Copy link
Member

Triage: still no changes, no substantial comments in over four years. @rust-lang/rustdoc are we interested in pursuing this feature?

@GuillaumeGomez
Copy link
Member

Maybe? More details on what's wanted would be appreciated here because I have difficulties to get the whole picture.

@SimonSapin
Copy link
Contributor Author

Well, you can visit https://doc.servo.org/servo/index.html and see that the sidebar as it is today is not particularly helpful. Since this issue was opened, the count went from 69 to 326 crates listed.

Maybe only listing same-workspace only would be a good start?

@QuietMisdreavus
Copy link
Member

Rustdoc doesn't have a concept of workspaces; only cargo does. If cargo gains the ability to only document items in the workspace, would that help any? (I'm not sure if such an ability already exists, to be honest...)

Currently, the crate list is dynamically loaded from the search index. If we want to provide a way to filter the crates list, it will affect the entire doc bundle, not just one crate's docs. Any change to the crates listing needs to confront that, whether by adding features to Cargo to only run docs for select crates, or for rustdoc to have some kind of listing that is on each file in the same crate that can be used to filter that list out.

@robinmoussu
Copy link

Personally I would like to have only the items of the current workspace in the side-bar (without any other changes).

@ehuss ehuss removed the T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. label Jan 18, 2022
@lolbinarycat lolbinarycat added A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Nov 7, 2024
@lolbinarycat
Copy link
Contributor

triage: still no change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

No branches or pull requests

8 participants