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

Host a non-#[doc(hidden)] Rust documentation for contributors #1778

Closed
hlbarber opened this issue Sep 28, 2022 · 2 comments
Closed

Host a non-#[doc(hidden)] Rust documentation for contributors #1778

hlbarber opened this issue Sep 28, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@hlbarber
Copy link
Contributor

We use #[doc(hidden)] extensively in the rust-runtime crates to allow for APIs to be public to the code generated code but not public to the general consumer to avoid semver constraints - if somethings #[doc(hidden)] we can change its API without the risk of breaking customer code.

This poses a problem for writing documentation for contributors however - docs are not able to point a link to a hosted document which contains API descriptions.

Compiling our own documentation in CI using

RUSTDOCFLAGS='-Z unstable-options --document-hidden-items' cargo +nightly doc

and then hosting it would remedy this.

In both the hidden and unhidden cases, having a link to the hosted documentation in the README.md would be beneficial.

As an additional side effect, we would also be able to catch broken doc links, lints, etc in CI. Running cargo doc in rust-runtime reveals 3 lints, running RUSTDOCFLAGS='-Z unstable-options --document-hidden-items' cargo +nightly doc reveals 50+.

@Velfi
Copy link
Contributor

Velfi commented Sep 28, 2022

Personally, I'd rather direct contributors to build the docs themselves using those options. I do agree that being able to find broken doc links would be beneficial.

@hlbarber hlbarber added the documentation Improvements or additions to documentation label Oct 6, 2022
@jdisanti
Copy link
Collaborator

jdisanti commented Apr 5, 2024

We use #[doc(hidden)] extensively in the rust-runtime crates to allow for APIs to be public to the code generated code but not public to the general consumer to avoid semver constraints

We no longer do this since it turns out the semver constraints are still there even with doc hidden. Going to resolve this since docs can also be built locally.

@jdisanti jdisanti closed this as completed Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants