Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b43aa96
Print failure message on all tests that should panic, but don't
johanngan Jan 10, 2021
679f6f3
Add `unwrap_unchecked()` methods for `Option` and `Result`
ojeda Jan 10, 2021
76299b3
Add `SAFETY` annotations
ojeda Jan 10, 2021
63a1eee
Reset LateContext enclosing body in nested items
camsteffen Jan 18, 2021
21fb586
Query for TypeckResults in LateContext::qpath_res
camsteffen Jan 18, 2021
def0e9b
Fix ICE with `ReadPointerAsBytes` validation error
camelid Jan 11, 2021
a7b7a43
Move test to `src/test/ui/consts/`
camelid Jan 11, 2021
eaba3da
Remove qpath_res util function
camsteffen Jan 18, 2021
e25959b
Make more traits of the From/Into family diagnostic items
flip1995 Jan 22, 2021
48f9dbf
clean up some const error reporting around promoteds
RalfJung Jan 24, 2021
6d4e03a
codegen: assume constants cannot fail to evaluate
RalfJung Jan 24, 2021
2be1993
Ignore test on 32-bit architectures
camelid Jan 25, 2021
59195a2
rustc_codegen_ssa: use wall time for codegen_to_LLVM_IR time-passes e…
tgnottingham Jan 25, 2021
26b4baf
Point to span of upvar making closure FnMut
sledgehammervampire Jan 18, 2021
088c89d
Account for generics when suggesting bound
estebank Jan 19, 2021
042facb
Fix some bugs reported by eslint
GuillaumeGomez Jan 23, 2021
0140dac
Link the reference about undefined behavior
ojeda Jan 25, 2021
01250fc
Add tracking issue
ojeda Jan 25, 2021
1c0a52d
rustdoc: Document CommonMark extensions.
ehuss Jan 25, 2021
6880d11
Rollup merge of #80868 - johanngan:should-panic-msg-with-expected, r=…
jonas-schievink Jan 25, 2021
975c4bc
Rollup merge of #80876 - ojeda:option-result-unwrap_unchecked, r=m-ou-se
jonas-schievink Jan 25, 2021
34abe17
Rollup merge of #80900 - camelid:readpointerasbytes-ice, r=oli-obk
jonas-schievink Jan 25, 2021
79ddb67
Rollup merge of #81158 - 1000teslas:issue-80313-fix, r=Aaron1011
jonas-schievink Jan 25, 2021
3210a25
Rollup merge of #81176 - camsteffen:qpath-res, r=oli-obk
jonas-schievink Jan 25, 2021
c2b8cd7
Rollup merge of #81195 - estebank:suggest-bound-on-trait-with-params,…
jonas-schievink Jan 25, 2021
1cbd775
Rollup merge of #81277 - flip1995:from_diag_items, r=matthewjasper
jonas-schievink Jan 25, 2021
457b3da
Rollup merge of #81299 - GuillaumeGomez:fix-eslint-detected-bugs, r=N…
jonas-schievink Jan 25, 2021
06ef1bf
Rollup merge of #81327 - RalfJung:codegen-no-const-fail, r=oli-obk
jonas-schievink Jan 25, 2021
34ca9c5
Rollup merge of #81333 - RalfJung:const-err-simplify, r=oli-obk
jonas-schievink Jan 25, 2021
f308d77
Rollup merge of #81369 - tgnottingham:codegen-to-llvm-ir-wall-time, r…
jonas-schievink Jan 25, 2021
ba8379b
Rollup merge of #81389 - ehuss:rustdoc-cmark-extensions, r=GuillaumeG…
jonas-schievink Jan 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustdoc: Document CommonMark extensions.
  • Loading branch information
ehuss committed Jan 25, 2021
commit 1c0a52d304cdebfcdf57c528b413457030659eb0
66 changes: 65 additions & 1 deletion src/doc/rustdoc/src/how-to-write-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,73 @@ and finally provides a code example.

## Markdown

`rustdoc` uses the [commonmark markdown specification]. You might be
`rustdoc` uses the [CommonMark markdown specification]. You might be
interested into taking a look at their website to see what's possible to do.
- [commonmark quick reference]
- [current spec]

In addition to the standard CommonMark syntax, `rustdoc` supports several
extensions:

### Strikethrough

Text may be rendered with a horizontal line through the center by wrapping the
text with two tilde characters on each side:

```text
An example of ~~strikethrough text~~.
```

This example will render as:

> An example of ~~strikethrough text~~.

This follows the [GitHub Strikethrough extension][strikethrough].

### Footnotes

A footnote generates a small numbered link in the text which when clicked
takes the reader to the footnote text at the bottom of the item. The footnote
label is written similarly to a link reference with a caret at the front. The
footnote text is written like a link reference definition, with the text
following the label. Example:

```text
This is an example of a footnote[^note].

[^note]: This text is the contents of the footnote, which will be rendered
towards the bottom.
```

This example will render as:

> This is an example of a footnote[^note].
>
> [^note]: This text is the contents of the footnote, which will be rendered
> towards the bottom.

The footnotes are automatically numbered based on the order the footnotes are
written.

### Tables

Tables can be written using pipes and dashes to draw the rows and columns of
the table. These will be translated to HTML table matching the shape. Example:

```text
| Header1 | Header2 |
|---------|---------|
| abc | def |
```

This example will render similarly to this:

> | Header1 | Header2 |
> |---------|---------|
> | abc | def |

See the specification for the [GitHub Tables extension][tables] for more
details on the exact syntax supported.

[`backtrace`]: https://docs.rs/backtrace/0.3.50/backtrace/
[commonmark markdown specification]: https://commonmark.org/
Expand All @@ -170,3 +232,5 @@ interested into taking a look at their website to see what's possible to do.
[standard library]: https://doc.rust-lang.org/stable/std/index.html
[current spec]: https://spec.commonmark.org/current/
[`std::env`]: https://doc.rust-lang.org/stable/std/env/index.html#functions
[strikethrough]: https://github.github.com/gfm/#strikethrough-extension-
[tables]: https://github.github.com/gfm/#tables-extension-