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

docs: add root level documentation for all libraries #3202

Merged
merged 6 commits into from
Aug 15, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Aug 14, 2024

What's this all about?

This PR adds crate-/root-level documentation for all library crates. All crates except windows-implement and windows-interface, import the documentation (with doctests) from their README.md.

windows-sys and windows include examples with some required features. Rustdoc can't infer them, so the inclusion of the README is only done if they're enabled. For windows this also checks if docsrs isn't set (although docs.rs should build without any enabled features).

Doctests are running in CI with cargo test --doc -p <crate> and documentation is generated with cargo doc --no-deps -p <crate>.

You can verify the output with

cargo doc --no-deps `
  -p windows-bindgen `
  -p windows-core `
  -p cppwinrt `
  -p windows-implement `
  -p windows-interface `
  -p windows-metadata `
  -p windows-registry `
  -p windows-result `
  -p windows-strings `
  -p windows-targets `
  -p windows-version `
  -p windows `
    -F Data_Xml_Dom `
    -F Win32_Security `
    -F Win32_System_Threading `
    -F Win32_UI_WindowsAndMessaging `
  -p windows-sys `
    -F Win32_Security `
    -F Win32_System_Threading `
    -F Win32_UI_WindowsAndMessaging `
  --open

Fixes: #3187

Copy link
Collaborator

@kennykerr kennykerr left a comment

Choose a reason for hiding this comment

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

Thanks!

@kennykerr kennykerr merged commit ffe93a7 into microsoft:master Aug 15, 2024
79 checks passed
@kennykerr
Copy link
Collaborator

windows-sys and windows include examples with some required features. Rustdoc can't infer them, so the inclusion of the README is only done if they're enabled.

Just playing around with it and it looks good for most crates but this point for the windows and windows-sys crates seems problematic as I don't see how this would ever be the case in practice so I'm wondering what it's even for. Is it just to test the readme? test_readme already does that.

@Nerixyz
Copy link
Contributor Author

Nerixyz commented Aug 15, 2024

Just playing around with it and it looks good for most crates but this point for the windows and windows-sys crates seems problematic as I don't see how this would ever be the case in practice so I'm wondering what it's even for. Is it just to test the readme? test_readme already does that.

Oh, I didn't see that test. Then the doctests I added to CI can be removed (since there aren't any doctests outside the readmes).

@Nerixyz Nerixyz deleted the docs/add-top-level branch August 15, 2024 16:18
This was referenced Aug 15, 2024
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.

Root level documentation for crates is very sparse
2 participants