RFC: Rework feature documentation #1685
zeylahellyer
started this conversation in
Development & RFCs
Replies: 1 comment
-
i think it'd also make sense to add "(required)" or "*" to parents in the list, to indicate one of the features is required, and for optional parents, a "none" item would be useful to say when you wouldn't enable anything, like http's TLS feature not being enabled for proxy usages |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What?
Rework how we document features to make our crate documentation leaner, more concise, and open up documentation "real estate" to enable documenting more about what the crates actually are.
Why?
The crate-level documentation for the gateway crate has 74 lines of textual documentation, excluding newlines. Of this, 2 are dedicated to the header and badge links, 10 for what the crate is, 3 for pointing to the in-repository examples, and the remaining 59 are dedicated to documenting features. It's possible to continue documenting feature inline to the crate documentation while drastically reducing the line count, freeing up space for documentation on what the crate is, why you would use it, and an example of what using it looks like.
How?
Create a list of feature names paired with their description. On the surface this could make it unclear which features are grouped together or mutually exclusive, so we can make sub-lists for each category where necessary. Here's what the documentation for TLS features in the gateway crate looks like:
This is a lot of repeated information. Information that, as it is, is repeated, quite a lot. To reduce the amount of repeated information, we can remove the repetition by simplifying all of this documented TLS information into a list:
If we make a list for everything then it looks pretty good:
And that's it! This just reduced 59 lines of documentation into 8.
After the library's website is revamped we can also point to our website for additional information on the benefits and drawbacks of each of these options are (why choose
rustls-native-roots
overrustls-webpki-roots
?), but for now this would reduce the size of the documentation while not taking important information away and pointing users to resources that can educate them on whatsimd-json
orrustls
are.Beta Was this translation helpful? Give feedback.
All reactions