Skip to content

Commit

Permalink
Make it clear that rustdoc uses the commonmark spec (#1622)
Browse files Browse the repository at this point in the history
  • Loading branch information
MonliH authored Oct 5, 2022
1 parent 3c4fa5c commit 5e7b296
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/testing/doc_testing.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Documentation testing

The primary way of documenting a Rust project is through annotating the source
code. Documentation comments are written in [markdown] and support code
blocks in them. Rust takes care about correctness, so these code blocks are
compiled and used as documentation tests.
code. Documentation comments are written in
[CommonMark Markdown specification][commonmark] and support code blocks in them.
Rust takes care about correctness, so these code blocks are compiled and used
as documentation tests.

```rust,ignore
/// First line is a short summary describing function.
Expand Down Expand Up @@ -106,6 +107,6 @@ pub fn try_div(a: i32, b: i32) -> Result<i32, String> {
* [API Guidelines][doc-nursery] on documentation guidelines
[doc-nursery]: https://rust-lang-nursery.github.io/api-guidelines/documentation.html
[markdown]: https://daringfireball.net/projects/markdown/
[commonmark]: https://commonmark.org/
[RFC505]: https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md
[question-instead-of-unwrap]: https://rust-lang-nursery.github.io/api-guidelines/documentation.html#examples-use--not-try-not-unwrap-c-question-mark

0 comments on commit 5e7b296

Please sign in to comment.