address review comments

This commit is contained in:
Mark Mansi 2018-03-15 09:38:50 -05:00 committed by Who? Me?!
parent 4026b02fc8
commit 474bdb566c
2 changed files with 12 additions and 6 deletions

View File

@ -23,3 +23,4 @@ Item | Kind | Short description | Chapter |
[The Rustc Driver]: rustc-driver.html [The Rustc Driver]: rustc-driver.html
[Type checking]: type-checking.html [Type checking]: type-checking.html
[The `ty` modules]: ty.html [The `ty` modules]: ty.html
[Rustdoc]: rustdoc.html

View File

@ -87,7 +87,7 @@ The other major thing that happens in `clean/mod.rs` is the collection of doc co
`#[doc=""]` attributes into a separate field of the Attributes struct, present on anything that gets `#[doc=""]` attributes into a separate field of the Attributes struct, present on anything that gets
hand-written documentation. This makes it easier to collect this documentation later in the process. hand-written documentation. This makes it easier to collect this documentation later in the process.
The primary output of this process is a clean::Crate with a tree of Items which describe the The primary output of this process is a `clean::Crate` with a tree of Items which describe the
publicly-documentable items in the target crate. publicly-documentable items in the target crate.
### Hot potato ### Hot potato
@ -107,21 +107,26 @@ deprecate that][44136]. If you need finer-grain control over these passes, pleas
Here is current (as of this writing) list of passes: Here is current (as of this writing) list of passes:
- `collapse-docs` is necessary because each line of a doc comment is given as a - `propagate-doc-cfg` - propagates `#[doc(cfg(...))]` to child items.
- `collapse-docs` concatenates all document attributes into one document
attribute. This is necessary because each line of a doc comment is given as a
separate doc attribute, and this will combine them into a single string with separate doc attribute, and this will combine them into a single string with
line breaks between each attribute. line breaks between each attribute.
- `unindent-comments` is necessary because the convention for writing - `unindent-comments` removes excess indentation on comments in order for
markdown to like it. This is necessary because the convention for writing
documentation is to provide a space between the `///` or `//!` marker and the documentation is to provide a space between the `///` or `//!` marker and the
text, and stripping that leading space will make the text easier to parse by text, and stripping that leading space will make the text easier to parse by
the Markdown parser. (In my experience it's less necessary now that we have a the Markdown parser. (In my experience it's less necessary now that we have a
Commonmark-compliant parser, since it doesn't have a problem with headers Commonmark-compliant parser, since it doesn't have a problem with headers
that have a space before the `##` that marks the heading.) that have a space before the `##` that marks the heading.)
- `strip-priv-imports` is necessary because rustdoc will handle *public* - `strip-priv-imports` strips all private import statements (`use`, `extern
crate`) from a crate. This is necessary because rustdoc will handle *public*
imports by either inlining the item's documentation to the module or creating imports by either inlining the item's documentation to the module or creating
a "Reexports" section with the import in it. The pass ensures that all of a "Reexports" section with the import in it. The pass ensures that all of
these imports are actually relevant to documentation. these imports are actually relevant to documentation.
- `strip-hidden` and `strip-private` also remove items that are not relevant - `strip-hidden` and `strip-private` strip all `doc(hidden)` and private items
for public documentation. from the output. `strip-private` implies `strip-priv-imports`. Basically, the
goal is to remove items that are not relevant for public documentation.
## From clean to crate ## From clean to crate