Skip to content

Commit ef8ecf2

Browse files
authored
Rollup merge of rust-lang#34667 - KaivoAnastetiks:fix/crate-documentation, r=Manishearth
Add a section about crate documentation. Fixes rust-lang#34329 ?r @steveklabnik
2 parents 5e9dbcc + 159d1ab commit ef8ecf2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/doc/book/documentation.md

+11
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,17 @@ you have a module in `foo.rs`, you'll often open its code and see this:
486486
//! The `foo` module contains a lot of useful functionality blah blah blah
487487
```
488488

489+
### Crate documentation
490+
491+
Crates can be documented by placing an inner doc comment (`//!`) at the
492+
beginning of the crate root, aka `lib.rs`:
493+
494+
```rust
495+
//! This is documentation for the `foo` crate.
496+
//!
497+
//! The foo crate is meant to be used for bar.
498+
```
499+
489500
### Documentation comment style
490501

491502
Check out [RFC 505][rfc505] for full conventions around the style and format of

0 commit comments

Comments
 (0)