-
Notifications
You must be signed in to change notification settings - Fork 13
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
Update public API docs #197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments inline that you are free to ignore :)
src/data_request.rs
Outdated
/// Returns a mutable reference to a [DataRequest] that includes | ||
/// glyph layers and points if `b` is `true` or excludes these | ||
/// data if `b` is `false`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust doc comments work a lot like git commits: the first line is used as a short summary (and is shown beside an item in the module level docs), and then anything after the first newline is "additional detail" and is only shown on the docs page for that specific item.
So basically: one short line that is a summary, and then anything else below the fold.
In this case though, I'm not sure that the new docs are an improvement on the previous ones? In particular I don't think it is necessary to mention that this returns &mut Self
. This pattern should be familiar to the caller from std
(see std::process::Command
). If the previous docstring was too vague, I might instead say,
/// Specify whether layers (and glyphs) should be loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted. I will have a look into this one tonight and respond.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this information Colin. I agree with your comments here and revised the initial draft in fb78ef7
Please let me know if you feel that this improves the documentation in the section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related:
I've tended towards adding a # Notes
header in documentation sections that have longer and/or multi-issue text content below the summary line. IMO this sets it off nicely in the HTML site, but this is very subjective. If you feel that this leads to unnecessary header clutter in the docs please let me know. I should have a full first draft available by the end of the day so that we can have a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that std
is a great guideline, and we should try to match the conventions used there. They don't seem to use # Note
as a header very often, but they do often have lines that begin with 'Note:', for providing information that is not important in the general case, but is important to a deeper understanding of the API: see for instance the docs for String::drain
.
I do think I've seen # Note:
before, but generally for a longform exposition of some idea or concept, but I can't find an example. The best I can come up with is the A ghastly note section of PhantomData
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vs. this after 314e216
Ty!! |
font module doc updates in 1462bca |
At this stage, I am simply trying to get a first draft of documentation in place across everything that is public. We're nearly there. There are 38 missing public X documentation warnings left as of 2c9325f, down from nearly 400. The next step will be another pass for revisions with additional examples where appropriate and confirmation that the new content is valid/accurate, concise, and properly formatted in the production HTML site gen'd with Please don't hesitate to edit this branch directly if you come across anything that should be changed. |
As of 30a30a8, the entire public API is documented and clippy should no longer raise errors. Converted out of Draft status. This is ready for review. I will continue to work on the revisions noted in #197 (comment) and #197 (comment) |
Co-authored-by: Colin Rofls <[email protected]>
Co-authored-by: Colin Rofls <[email protected]>
Co-authored-by: Colin Rofls <[email protected]>
Co-authored-by: Colin Rofls <[email protected]>
Co-authored-by: Colin Rofls <[email protected]>
Co-authored-by: Colin Rofls <[email protected]>
this is consistent with the approach in the std lib. Plural is used even if there is a single example provided
14924b4
to
48d62ce
Compare
Rebased on #201 |
Question about the breadth of the docs: In e.g. a |
IMO, yes. I am a fan of comprehensive docs. |
Should we merge this before any significant source changes land? I can keep an eye out and rebase / edit in this branch if you'd prefer to keep this open for now. |
I'd like it merged so we have less work with subsequent PRs :) @cmyr ? |
Sure let's get this in and we can always touch it up later :) |
Thank you both very much for the reviews! |
Adds the
#![warn(missing_docs)]
attribute and full public API documentationRelated #195