diff --git a/files/en-us/mdn/contribute/markdown_in_mdn/index.html b/files/en-us/mdn/contribute/markdown_in_mdn/index.html index 6b3d213796af5dc..16cca9dbfd6eb5a 100644 --- a/files/en-us/mdn/contribute/markdown_in_mdn/index.html +++ b/files/en-us/mdn/contribute/markdown_in_mdn/index.html @@ -113,7 +113,150 @@
Sometimes writers want to call special attention to some piece of content. To do this, they will use a GFM blockquote with a special first paragraph. There are three types of these: notes, warnings, and callouts.
+ +**Note:**
.**Warning:**
.**Callout:**
.Notes and warnings will render the Note: or Warning: text in the output, while callouts will not. This makes callouts a good choice when an author wants to provide a custom title.
+ +Processing of the markup works on the AST it produces, not on the exact characters provided. This means that providing <strong>Note:</strong>
will also generate a note. However, the Markdown syntax is required as a matter of style.
Multiple lines are produced by an empty block quote line in the same way as normal paragraphs. Further, multiple lines without a space are also treated like normal markdown lines, and concatenated.
+ +The blockquote can contain code blocks or other block elements.
+ +Because the text "Note:" or "Warning:" also appears in the rendered output, it has to be sensitive to translations. In practice this means that every locale supported by MDN must supply its own translation of these strings, and the platform must recognize them as indicating that the construct needs special treatment.
+ ++> **Note:** This is how you write a note. +> +> It can have multiple lines. ++ +
This will produce the following HTML:
+ ++<div class="notecard note"> + <p><strong>Note:</strong> This is how you write a note.</p> + <p>It can have multiple lines.</p> +</div> ++ +
This HTML will be rendered as a highlighted box, like:
+ +Note: This is how you write a note.
+It can have multiple lines.
++> **Warning: This is how you write a warning. +> +> It can have multiple paragraphs. ++ +
This will produce the following HTML:
+ ++<div class="notecard warning"> + <p><strong>Warning:</strong> This is how you write a warning.</p> + <p>It can have multiple paragraphs.</p> +</div> ++ +
This HTML will be rendered as a highlighted box, like:
+ +Warning: This is how you write a warning.
+It can have multiple paragraphs.
++> **Callout:** **This is how you write a callout**. +> +> It can have multiple paragaphs. ++ +
This will produce the following HTML:
+ ++<div class="callout"> + <p><strong>This is how you write a callout.</strong></p> + <p>It can have multiple paragraphs.</p> +</div> ++ +
This HTML will be rendered as a highlighted box, like:
+ +This is how you write a callout.
+It can have multiple paragraphs.
+For example, if we want to use "Warnung" for "Warning" in German, then in German pages we would write:
+ ++> Warnung: So schreibt man eine Warnung. ++ +
...and this will produce:
+ ++<div class="notecard warning"> + <p><strong>Warnung:</strong> So schreibt man eine Warnung.</p> +</div> ++ +
This example contains a code block.
+ ++> **Note:** This is how you write a note. +> +> It can contain code blocks. +> +> ```js +> const s = "I'm in a code block"; +> ``` +> Like that. ++ +
This will produce the following HTML:
+ ++<div class="notecard note"> + <p><strong>Note:</strong> This is how you write a note.</p> + <p>It can contain code blocks.</p> + <pre class="brush: js">const s = "I'm in a code block";</pre> + <p>Like that.</p> +</div> ++ +
This HTML will be rendered as with a code block, like:
+ +Note: This is how you write a note.
+It can contain code blocks.
+const s = "I'm in a code block";+
Like that.
+