Skip to content

Commit d9a5dcb

Browse files
authored
Unrolled build for rust-lang#119245
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`
2 parents edcbcc7 + ca2f8da commit d9a5dcb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/doc/rustdoc/src/how-to-write-documentation.md

+16
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,22 @@ you can wrap it like this:
267267
/// more documentation
268268
```
269269

270+
Please note that if you want to put markdown in the HTML tag and for it to
271+
be interpreted as such, you need to have an empty line between the HTML tags
272+
and your markdown content. For example if you want to use a link:
273+
274+
```md
275+
/// documentation
276+
///
277+
/// <div class="warning">
278+
///
279+
/// Go to [this link](https://rust-lang.org)!
280+
///
281+
/// </div>
282+
///
283+
/// more documentation
284+
```
285+
270286
[`backtrace`]: https://docs.rs/backtrace/0.3.50/backtrace/
271287
[commonmark markdown specification]: https://commonmark.org/
272288
[commonmark quick reference]: https://commonmark.org/help/

0 commit comments

Comments
 (0)