about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-12-23 16:23:55 +0100
committerGitHub <noreply@github.com>2023-12-23 16:23:55 +0100
commita46ce0060aa7aa108188090483f9e60f92e371eb (patch)
tree2ad0cd21d5536a0b032c121045f20986b31ed4c5 /src
parentea55fd8c7f5ca489d9f30c42bfef39c446561097 (diff)
parentca2f8da5f16892f100017d043866d12b87a13287 (diff)
Rollup merge of #119245 - GuillaumeGomez:improve-docs, r=fmease
Improve documentation for using warning blocks in documentation

From [this comment](https://github.com/rust-lang/rust/issues/79710#issuecomment-1868225357), I think markdown can be surprising sometimes so better explain a bit better how to use it correctly.

r? `@notriddle`
Diffstat (limited to 'src')
-rw-r--r--src/doc/rustdoc/src/how-to-write-documentation.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/doc/rustdoc/src/how-to-write-documentation.md b/src/doc/rustdoc/src/how-to-write-documentation.md
index acab1a93690..8994c01f824 100644
--- a/src/doc/rustdoc/src/how-to-write-documentation.md
+++ b/src/doc/rustdoc/src/how-to-write-documentation.md
@@ -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/