Skip to content

Commit 7c2af89

Browse files
committed
address review comments
1 parent 21ed6e6 commit 7c2af89

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Diff for: src/appendix-code-index.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ Item | Kind | Short description | Chapter |
2323
[The Rustc Driver]: rustc-driver.html
2424
[Type checking]: type-checking.html
2525
[The `ty` modules]: ty.html
26+
[Rustdoc]: rustdoc.html

Diff for: src/rustdoc.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The other major thing that happens in `clean/mod.rs` is the collection of doc co
8787
`#[doc=""]` attributes into a separate field of the Attributes struct, present on anything that gets
8888
hand-written documentation. This makes it easier to collect this documentation later in the process.
8989

90-
The primary output of this process is a clean::Crate with a tree of Items which describe the
90+
The primary output of this process is a `clean::Crate` with a tree of Items which describe the
9191
publicly-documentable items in the target crate.
9292

9393
### Hot potato
@@ -107,21 +107,26 @@ deprecate that][44136]. If you need finer-grain control over these passes, pleas
107107

108108
Here is current (as of this writing) list of passes:
109109

110-
- `collapse-docs` is necessary because each line of a doc comment is given as a
110+
- `propagate-doc-cfg` - propagates `#[doc(cfg(...))]` to child items.
111+
- `collapse-docs` concatenates all document attributes into one document
112+
attribute. This is necessary because each line of a doc comment is given as a
111113
separate doc attribute, and this will combine them into a single string with
112114
line breaks between each attribute.
113-
- `unindent-comments` is necessary because the convention for writing
115+
- `unindent-comments` removes excess indentation on comments in order for
116+
markdown to like it. This is necessary because the convention for writing
114117
documentation is to provide a space between the `///` or `//!` marker and the
115118
text, and stripping that leading space will make the text easier to parse by
116119
the Markdown parser. (In my experience it's less necessary now that we have a
117120
Commonmark-compliant parser, since it doesn't have a problem with headers
118121
that have a space before the `##` that marks the heading.)
119-
- `strip-priv-imports` is necessary because rustdoc will handle *public*
122+
- `strip-priv-imports` strips all private import statements (`use`, `extern
123+
crate`) from a crate. This is necessary because rustdoc will handle *public*
120124
imports by either inlining the item's documentation to the module or creating
121125
a "Reexports" section with the import in it. The pass ensures that all of
122126
these imports are actually relevant to documentation.
123-
- `strip-hidden` and `strip-private` also remove items that are not relevant
124-
for public documentation.
127+
- `strip-hidden` and `strip-private` strip all `doc(hidden)` and private items
128+
from the output. `strip-private` implies `strip-priv-imports`. Basically, the
129+
goal is to remove items that are not relevant for public documentation.
125130

126131
## From clean to crate
127132

0 commit comments

Comments
 (0)