Skip to content

Commit a90b64a

Browse files
authored
Merge pull request #1183 from felixrabe/patch-2
Improve section Meta/Docs
2 parents a18c3c4 + 144dcb3 commit a90b64a

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

src/meta/doc.md

+25-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# Documentation
22

3+
Use `cargo doc` to build documentation in `target/doc`.
4+
5+
Use `cargo test` to run all tests (including documentation tests), and `cargo test --doc` to only run documentation tests.
6+
7+
These commands will appropriately invoke `rustdoc` (and `rustc`) as required.
8+
9+
### Doc comments
10+
311
Doc comments are very useful for big projects that require documentation. When
4-
running [Rustdoc][1], these are the comments that get compiled into
5-
documentation. They are denoted by a `///`, and support [Markdown][2].
12+
running Rustdoc, these are the comments that get compiled into
13+
documentation. They are denoted by a `///`, and support [Markdown].
614

715
```rust,editable,ignore
816
#![crate_name = "doc"]
@@ -57,8 +65,19 @@ $ rustc doc.rs --crate-type lib
5765
$ rustdoc --test --extern doc="libdoc.rlib" doc.rs
5866
```
5967

60-
(When you run `cargo test` on a library crate, Cargo will automatically
61-
generate and run the correct rustc and rustdoc commands.)
68+
### See also:
69+
70+
* [The Rust Book: Making Useful Documentation Comments][book]
71+
* [The Rustdoc Book][rustdoc-book]
72+
* [The Reference: Doc comments][ref-comments]
73+
* [RFC 1574: API Documentation Conventions][api-conv]
74+
* [RFC 1946: Relative links to other items from doc comments (intra-rustdoc links)][intra-links]
75+
* [Is there any documentation style guide for comments? (reddit)][reddit]
6276

63-
[1]: https://doc.rust-lang.org/book/documentation.html
64-
[2]: https://en.wikipedia.org/wiki/Markdown
77+
[Markdown]: https://en.wikipedia.org/wiki/Markdown
78+
[book]: https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html#making-useful-documentation-comments
79+
[ref-comments]: https://doc.rust-lang.org/stable/reference/comments.html#doc-comments
80+
[rustdoc-book]: https://doc.rust-lang.org/rustdoc/index.html
81+
[api-conv]: https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text
82+
[intra-links]: https://rust-lang.github.io/rfcs/1946-intra-rustdoc-links.html
83+
[reddit]: https://www.reddit.com/r/rust/comments/ahb50s/is_there_any_documentation_style_guide_for/

0 commit comments

Comments
 (0)