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

Convert comments to doc comments where sensible #36

Merged
merged 1 commit into from
Feb 27, 2024
Merged

Conversation

tertsdiepraam
Copy link
Contributor

Using doc comments has a couple of advantages:

  • The documentation shows up in rustdoc.
  • IDE's show the doc comments on hover.
  • Rustdoc can warn when links to items are invalid, which helps with keeping the docs up to date.

Rustdoc works best with this format:

/// <one line summary>
///
/// <longer description>

Because it will then only show the summary in some places, but I haven't changed all comments to this format and left a lot as is.

I also tried adding backticks and brackets for inline code and links, but I've undoubtedly missed a few places.

In the current version, rustdoc will generate a few warnings because I link to a few private items from public items. I'd have to know more about the internals to fix this properly and the documentation still works.

All documentation can be viewed with

cargo doc --document-private-items --open

@tertsdiepraam tertsdiepraam merged commit a63d8ab into main Feb 27, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants