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 book: acknowledge --document-hidden-items #132876

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

lolbinarycat
Copy link
Contributor

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Nov 10, 2024

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 10, 2024
`--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)]`
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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...

Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@aDotInTheVoid
Copy link
Member

r? @aDotInTheVoid

@@ -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`.
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

?

Copy link
Contributor Author

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.

Copy link
Member

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
Copy link
Member

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.

Copy link
Contributor Author

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)]`.
Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@aDotInTheVoid aDotInTheVoid added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Nov 10, 2024
@lolbinarycat
Copy link
Contributor Author

@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.

@rust-log-analyzer

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.
Copy link
Member

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.

Copy link
Contributor Author

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.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 11, 2024
…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`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 12, 2024
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`
@aDotInTheVoid aDotInTheVoid changed the title rustdoc book: acknowlage --document-hidden-items rustdoc book: acknowledge --document-hidden-items Dec 9, 2024
@GuillaumeGomez
Copy link
Member

Ping @lolbinarycat. I see a few comments that were not implemented yet. :)

@lolbinarycat
Copy link
Contributor Author

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.

@lolbinarycat
Copy link
Contributor Author

@GuillaumeGomez I've added the truth table and reworded the docs for --document-private-items, most of the other stuff I feel like should stay for completeness or consistency. Is there anything you think absolutely needs to be changed?

@lolbinarycat
Copy link
Contributor Author

@GuillaumeGomez visibility marker icons are now documented

@GuillaumeGomez
Copy link
Member

Looks good to me, thanks! Please squash your commits then r=me

@lolbinarycat lolbinarycat force-pushed the rustdoc-document-hidden-items branch from aa0ac7a to ff7533e Compare February 20, 2025 23:06
@lolbinarycat
Copy link
Contributor Author

r=@GuillaumeGomez

@GuillaumeGomez
Copy link
Member

@bors delegate=lolbinarycat

@bors
Copy link
Contributor

bors commented Feb 20, 2025

✌️ @lolbinarycat, you can now approve this pull request!

If @GuillaumeGomez told you to "r=me" after making some further change, please make that change, then do @bors r=@GuillaumeGomez

@GuillaumeGomez
Copy link
Member

And please wait for CI to be done before r+ing.

@lolbinarycat
Copy link
Contributor Author

@GuillaumeGomez shouldn't this get rolled up, as a documentation change?

@GuillaumeGomez
Copy link
Member

Yes it should, add "rollup" after the "r=me" command.

@lolbinarycat
Copy link
Contributor Author

@bors r=@GuillaumeGomez rollup

@bors
Copy link
Contributor

bors commented Feb 21, 2025

📌 Commit ff7533e has been approved by GuillaumeGomez

It is now in the queue for this repository.

@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 Feb 21, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 21, 2025
…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
@bors bors merged commit 4395618 into rust-lang:master Feb 21, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Feb 21, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 21, 2025
Rollup merge of rust-lang#132876 - lolbinarycat:rustdoc-document-hidden-items, r=GuillaumeGomez

rustdoc book: acknowledge --document-hidden-items
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 27, 2025
…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
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this pull request Mar 11, 2025
…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
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this pull request Mar 11, 2025
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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