Skip to content

Commit

Permalink
Rollup merge of rust-lang#119245 - GuillaumeGomez:improve-docs, r=fmease
Browse files Browse the repository at this point in the history
Improve documentation for using warning blocks in documentation

From [this comment](rust-lang#79710 (comment)), I think markdown can be surprising sometimes so better explain a bit better how to use it correctly.

r? `@notriddle`
  • Loading branch information
matthiaskrgr authored Dec 23, 2023
2 parents ea55fd8 + ca2f8da commit a46ce00
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/doc/rustdoc/src/how-to-write-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,22 @@ you can wrap it like this:
/// more documentation
```

Please note that if you want to put markdown in the HTML tag and for it to
be interpreted as such, you need to have an empty line between the HTML tags
and your markdown content. For example if you want to use a link:

```md
/// documentation
///
/// <div class="warning">
///
/// Go to [this link](https://rust-lang.org)!
///
/// </div>
///
/// more documentation
```

[`backtrace`]: https://docs.rs/backtrace/0.3.50/backtrace/
[commonmark markdown specification]: https://commonmark.org/
[commonmark quick reference]: https://commonmark.org/help/
Expand Down

0 comments on commit a46ce00

Please sign in to comment.