-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 book: acknowledge --document-hidden-items #132876
rustdoc book: acknowledge --document-hidden-items #132876
Conversation
rustbot has assigned @GuillaumeGomez. Use |
`--document-private-items` documents all items, even if they're not public. | ||
`--document-private-items` causes all items to be documented as if they were `pub`. | ||
|
||
## `--document-hidden-items`: Show items that are `#[doc(hidden)]` |
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.
This should be on the page for unstable features, as it currently requires -Z unstable-options
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.
oh, that's weird, rustdoc --help
shows it with the stable options.
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.
oh.. yeah there's very little logic to how that's sorted...
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.
Command line option parsing was changed recently in #132754. Maybe it did something wrong? If not, we need to fix that.
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 think "rustdoc doesn't make it clear what options are unstable" is a longstanding issue, attempts at fixing it have been made before, but I believe they were reverted.
|
||
`--document-hidden-items` causes all items to be documented as if they did not have `#[doc(hidden)]`. | ||
|
||
items that are hidden and private will only be documented if both `--document-hidden-items` *and* `--document-private-items` are specified. |
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.
items that are hidden and private will only be documented if both `--document-hidden-items` *and* `--document-private-items` are specified. | |
Items that are hidden and private will only be documented if both `--document-hidden-items` *and* `--document-private-items` are specified. |
@@ -100,7 +100,16 @@ mod private { // this item is private and will not be documented | |||
} | |||
``` | |||
|
|||
`--document-private-items` documents all items, even if they're not public. | |||
`--document-private-items` causes all items to be documented as if they were `pub`. |
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's actually not the case. It shows them up with a little lock alongside them, but it's not the same as if they were pub
.
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 mean that the logic for whether or not they are included will be the same as that for pub
items.
The previous wording implied that it also shows doc(hidden)
items, which it does not.
I am not sure how to word it more clearly without being overly verbose.
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.
What do you think about:
--document-private-items
includes all non-public in the generated documentation, but not#[doc(hidden)]
items.
?
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 say "except for", but other than that, it should be fine as long as we don't add another separate condition that prevents items from being documented.
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.
Sounds good. :)
|
||
## `--document-hidden-items`: Show items that are `#[doc(hidden)]` | ||
|
||
By default, `rustdoc` does not document items that are annotated with |
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.
That's a bit weird to specify it, it's literally the original meaning. I suppose you wanted to underline that #[doc(hidden)]
items were documented with this option? If so please reword it.
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 was mirroring the wording of --document-private-items
By default, `rustdoc` does not document items that are annotated with | ||
[`#[doc(hidden)]`](write-documentation/the-doc-attribute.html#hidden). | ||
|
||
`--document-hidden-items` causes all items to be documented as if they did not have `#[doc(hidden)]`. |
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 think you can remove this paragraph, it's what is said in the first line of this diff already so no need for repetition.
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.
You mean the heading? I'm following the existing style of other sections, which is that the body of a section should make sense without its heading.
|
||
`--document-hidden-items` causes all items to be documented as if they did not have `#[doc(hidden)]`. | ||
|
||
items that are hidden and private will only be documented if both `--document-hidden-items` *and* `--document-private-items` are specified. |
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 think it'd be better to say that private items will not be displayed with this option and that to have both, you need both options.
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.
that private items will not be displayed with this option
That's not strictly true, the option merely has no effect on if private items will be documented.
`#[doc(hidden)]` will be considered the same as private. | ||
Any item annotated with `#[doc(hidden)]` will not appear in the documentation, | ||
unless the `--document-hidden-items` flag is used. | ||
Re-exported items where one of its ancestors has |
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.
Hum... This part needs clarification about what "ancestor" is because re-exports of hidden items are displayed.
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.
Yeah it sure does! I don't really have access to that information though, I'm working off of very limited documentation.
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.
Then please remove this sentence completely.
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.
Still waiting for this one.
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.
ping
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.
Now that I've done more work on rustdoc, I'd rather just read through the source to figure this out... or maybe i'll just remove it an open an issue to investigate this.
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.
Nope, can't replicate it, removing.
@GuillaumeGomez I'll be honest, I have no idea what you want me to do. Feedback such as "reword it" is not specific enough to be actionable. Additionally, splitting feedback into lots of little chucks like this it hard to follow, partially due to issues with the github UI. |
This comment has been minimized.
This comment has been minimized.
|
||
`--document-hidden-items` causes all items to be documented as if they did not have `#[doc(hidden)]`. | ||
|
||
Items that are hidden and private will only be documented if both `--document-hidden-items` *and* `--document-private-items` are specified. |
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 think this paragraph can be removed with my suggestion for the previous paragraph.
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.
the --document-hidden-items
section is already much shorter than the sections for other unstable options, why does it need to be shorter?
also, your suggestion for the previous paragraph would only contribute to the misunderstanding this paragraph is trying to prevent.
…youxu triagebot: Autolabel rustdoc book Inspired by rust-lang#132876 not getting labeled as https://github.com/rust-lang/rust/labels/T-rustdoc r? `@GuillaumeGomez`
Rollup merge of rust-lang#132881 - aDotInTheVoid:docs-for-docs, r=jieyouxu triagebot: Autolabel rustdoc book Inspired by rust-lang#132876 not getting labeled as https://github.com/rust-lang/rust/labels/T-rustdoc r? `@GuillaumeGomez`
Ping @lolbinarycat. I see a few comments that were not implemented yet. :) |
I'll try to get back to this eventually, I've been focusing on other things and currently I can't work on anything because I don't have Internet. |
@GuillaumeGomez I've added the truth table and reworded the docs for |
@GuillaumeGomez visibility marker icons are now documented |
Looks good to me, thanks! Please squash your commits then r=me |
aa0ac7a
to
ff7533e
Compare
@bors delegate=lolbinarycat |
✌️ @lolbinarycat, you can now approve this pull request! If @GuillaumeGomez told you to " |
And please wait for CI to be done before r+ing. |
@GuillaumeGomez shouldn't this get rolled up, as a documentation change? |
Yes it should, add "rollup" after the "r=me" command. |
@bors r=@GuillaumeGomez rollup |
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#132876 (rustdoc book: acknowledge --document-hidden-items) - rust-lang#136148 (Optionally add type names to `TypeId`s.) - rust-lang#136609 (libcore/net: `IpAddr::as_octets()`) - rust-lang#137336 (Stabilise `os_str_display`) - rust-lang#137350 (Move methods from Map to TyCtxt, part 3.) - rust-lang#137353 (Implement `read_buf` for WASI stdin) - rust-lang#137361 (Refactor `OperandRef::extract_field` to prep for MCP838) - rust-lang#137367 (Do not exempt nonexistent platforms from platform policy) - rust-lang#137374 (Stacker now handles miri using a noop impl itself) - rust-lang#137392 (remove few unused fields) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#132876 - lolbinarycat:rustdoc-document-hidden-items, r=GuillaumeGomez rustdoc book: acknowledge --document-hidden-items
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#132876 (rustdoc book: acknowledge --document-hidden-items) - rust-lang#136148 (Optionally add type names to `TypeId`s.) - rust-lang#136609 (libcore/net: `IpAddr::as_octets()`) - rust-lang#137336 (Stabilise `os_str_display`) - rust-lang#137350 (Move methods from Map to TyCtxt, part 3.) - rust-lang#137353 (Implement `read_buf` for WASI stdin) - rust-lang#137361 (Refactor `OperandRef::extract_field` to prep for MCP838) - rust-lang#137367 (Do not exempt nonexistent platforms from platform policy) - rust-lang#137374 (Stacker now handles miri using a noop impl itself) - rust-lang#137392 (remove few unused fields) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#132876 (rustdoc book: acknowledge --document-hidden-items) - rust-lang#136148 (Optionally add type names to `TypeId`s.) - rust-lang#136609 (libcore/net: `IpAddr::as_octets()`) - rust-lang#137336 (Stabilise `os_str_display`) - rust-lang#137350 (Move methods from Map to TyCtxt, part 3.) - rust-lang#137353 (Implement `read_buf` for WASI stdin) - rust-lang#137361 (Refactor `OperandRef::extract_field` to prep for MCP838) - rust-lang#137367 (Do not exempt nonexistent platforms from platform policy) - rust-lang#137374 (Stacker now handles miri using a noop impl itself) - rust-lang#137392 (remove few unused fields) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#132876 (rustdoc book: acknowledge --document-hidden-items) - rust-lang#136148 (Optionally add type names to `TypeId`s.) - rust-lang#136609 (libcore/net: `IpAddr::as_octets()`) - rust-lang#137336 (Stabilise `os_str_display`) - rust-lang#137350 (Move methods from Map to TyCtxt, part 3.) - rust-lang#137353 (Implement `read_buf` for WASI stdin) - rust-lang#137361 (Refactor `OperandRef::extract_field` to prep for MCP838) - rust-lang#137367 (Do not exempt nonexistent platforms from platform policy) - rust-lang#137374 (Stacker now handles miri using a noop impl itself) - rust-lang#137392 (remove few unused fields) r? `@ghost` `@rustbot` modify labels: rollup
No description provided.