Skip to content

Commit

Permalink
Unrolled build for rust-lang#119245
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#119245 - GuillaumeGomez:improve-docs, r=fmease

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
rust-timer authored Dec 23, 2023
2 parents edcbcc7 + ca2f8da commit d9a5dcb
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 d9a5dcb

Please sign in to comment.