File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,29 @@ passes `-L`, a flag that helps rustdoc find the dependencies
9393your code relies on. If our project used dependencies, we'd get
9494documentation for them as well!
9595
96+ ## Outer and inner documentation
97+
98+ The ` /// ` syntax is used to document the item present after it.
99+ That's why it is called an outer documentation.
100+ There is another syntax: ` //! ` , which is used to document the
101+ item it is present inside. It is called an inner documentation.
102+ It is often used when documenting the entire crate,
103+ because nothing comes before it: it is the root of the crate.
104+ So in order to document an entire crate, you need to use ` //! ` syntax.
105+ For example:
106+
107+ ``` rust
108+ // ! This is my first rust crate
109+ ```
110+
111+ When used in the crate root, it documents the item it is inside,
112+ which is the crate itself.
113+
114+ For more information about the ` //! ` syntax, see [ the Book] .
115+
116+ [ the Book ] : https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html#commenting-contained-items
117+
118+
96119## Using standalone Markdown files
97120
98121` rustdoc ` can also generate HTML from standalone Markdown files. Let's
You can’t perform that action at this time.
0 commit comments