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

Checkbox to hide unstable things? #68184

Closed
gilescope opened this issue Jan 13, 2020 · 16 comments
Closed

Checkbox to hide unstable things? #68184

gilescope opened this issue Jan 13, 2020 · 16 comments
Labels
A-stability Area: issues related to #[stable] and #[unstable] attributes themselves. C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@gilescope
Copy link
Contributor

It would be great on the docs if there was a checkbox to hide nightly only methods in the generated documentation.
That gives us less methods to wade through to find the one we're after potentially, and may encourage people to pick stable methods by preference.

Apologies if this is the wrong repo for this request?

@GuillaumeGomez
Copy link
Member

I guess this is the good one. So if I follow correctly: you'd like an option somewhere to be able to hide nightly methods right? Which means that we can't generate both versions, that'd double the size. Therefore, we can do it using JS I guess. To be debated to check if we want more JS.

@gilescope
Copy link
Contributor Author

gilescope commented Jan 13, 2020 via email

@jyn514
Copy link
Member

jyn514 commented Jan 13, 2020

@GuillaumeGomez can you transfer to rust-lang/rust since this is a feature request for rustdoc?

@pietroalbini pietroalbini transferred this issue from rust-lang/docs.rs Jan 13, 2020
@pietroalbini
Copy link
Member

Transferred.

@jonas-schievink jonas-schievink added C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-stability Area: issues related to #[stable] and #[unstable] attributes themselves. labels Jan 13, 2020
@GuillaumeGomez
Copy link
Member

I can already tell that I'm not in favor to add this feature into rustdoc directly: it adds more front-end code for a small gain.

@joshtriplett
Copy link
Member

Not in the generated documentation pages (where it helps to know they exist), but perhaps in the search page. When doing a search, you might turn up many unstable methods, and it's good to know they exist, but then you might want to narrow to a method you can use and check that box. (It should always start out unchecked on each search, and just be something you can check to dynamically hide the unstable methods that the search turns up.)

@SimonSapin
Copy link
Contributor

Rather than a dynamic choice left to users, would it make sense to have a static configuration for https://doc.rust-lang.org/stable/std/ v.s. https://doc.rust-lang.org/nightly/std/ ?

@dcarosone
Copy link

I like the idea that it is just a display filter / toggle, along the lines of other sections that can be expanded and collapsed.

The default state of the toggle could be different depending on whether I'm running cargo doc on a nightly or stable toolchain - and for the web cases immediately above.

There are also deprecated things that might be worth filtering similarly, for the "simple" view of "what can I use on stable now?"

@GuillaumeGomez
Copy link
Member

@dcarosone This is more or less the case.

@SimonSapin Yes, I agree with you on this one.

@tesuji
Copy link
Contributor

tesuji commented Jul 15, 2020

cc #59853

@detly
Copy link

detly commented Jan 25, 2021

I am currently wading through the documentation on Box and almost every method is nightly-experimental. It is extremely hard to simply see the stable part of the API. I would love a way to switch this off and just focus on what I need.

(In other words, a checkbox to hide the blocks of nox would help the docs on Box not flummox.)

@txtyash
Copy link

txtyash commented Sep 23, 2023

It would be simpler to add badges to the search results to indicate whether a feature is nightly or not.

@dcarosone
Copy link

Whether you add a tag as content, or via an attribute for CSS to show badges for, is largely the same.
If added as an attribute, a CSS selector can then be used to hide the element.

The user experience is not at all the same if they have to mentally filter out even-more-complex visual annotation, or can toggle whether these are hidden.

@WiktorPrzetacznik
Copy link
Contributor

Some time has passed, are you still against this checkbox? I'd love to have this and even implement this (as another checkbox in the settings menu).
@GuillaumeGomez @joshtriplett

@GuillaumeGomez
Copy link
Member

I'll put it up to discussion in next rustdoc team meeting.

@GuillaumeGomez
Copy link
Member

It was discussed in the last rustdoc team meeting on zulip and we decided that it was not something that we wanted for rustdoc for the following reasons:

  • One benefit of showing the unstable APIs is that it invites people to test them, so having an opt-in for the curious would be good.
  • We want to avoid having too many settings. It's okay to see docs that are not relevant to you; almost all docs are irrelevant to almost all tasks.

Thanks for opening this issue in any case!

@camelid camelid closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stability Area: issues related to #[stable] and #[unstable] attributes themselves. C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests