-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc: add private items toggle #141299
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
base: master
Are you sure you want to change the base?
rustdoc: add private items toggle #141299
Conversation
The job Click to see the possible cause of the failure (guessed by this bot)
|
Thanks! This is the JS approach in the settings, nice. It is indeed simple. Quick note: could we show |
Before I forget, "one more thing" that is probably out of scope but related to this toggle: we could consider having a way to write "private documentation", e.g. in the Linux kernel we sometimes have private invariants that we put currently in the documentation in their own section ( |
yep, should be fairly simple, just another class and selector. currently private fields are always shown.
generally this is done by putting doc comments on private items, but it should be doable with another css selector, as long as you don't mind writing an explicit html element with an explicit class. |
That would be great to have, thanks!
These would be invariants on public items. I guess you mean moving everything into a new, private items? That I guess could work, but would be fairly complex just to add some private/implementation docs. The HTML workaround seems OK; however, I was thinking more of having some kind of proper support for private documentation, e.g. something like: /// Normal documentation.
///
/// My normal text.
//~
//~ # A private section
//~
//~ My private text.
pub struct S; And then, within the private docs, one could refer to private fields with intra-doc links, too. Or even have doctests etc. |
r? @ghost
@ojeda here's a MVP implementation of the feature you were talking about.
currently the search isn't affected at all, and additionally, there's no way to toggle the feature at the command line.
(DO NOT MERGE: the feature would be insta-stable)