You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WriteADoc add to the common markdwown syntax some popular extensions it calls "directives". A directive starts and end with at least three periods `:::` and a name:
6
+
7
+
```markdown
8
+
::: name | Some text
9
+
:option1:=value1
10
+
11
+
Markdown content
12
+
:::
13
+
```
14
+
15
+
The `|` after the name is optional
16
+
17
+
## Nested directives
18
+
19
+
You can nest directives to add, for example, an admonition inside an div. To do so just use more ":" to the outer directive:
Copy file name to clipboardExpand all lines: docs/content/markdown/html.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,8 @@ When the markdown attribute is set to "block", the parser will force block behav
66
66
67
67
The content of a block element is parsed into block-level content. In other words, the text is rendered as paragraphs, headers, lists, blockquotes, etc. Any inline syntax within those elements is processed as well.
68
68
69
-
/// example | Forced "block" markdown parsing
69
+
:::: div example
70
+
**Example: Forced "block" markdown parsing**
70
71
71
72
```md
72
73
<sectionmarkdown="block">
@@ -93,16 +94,14 @@ renders as:
93
94
</section>
94
95
```
95
96
96
-
///
97
-
98
-
<!---->
97
+
::::
99
98
100
-
/// warning
99
+
::: warning
101
100
Forcing elements to be parsed as `block` elements when they are not by default could result in invalid HTML.
102
101
103
102
For example, one could force a `<p>` element to be nested within another `<p>` element. In most cases, it is
104
103
recommended to use the default behavior of `markdown="1"`.
105
-
///
104
+
:::
106
105
107
106
108
107
### `markdown="span"`
@@ -111,7 +110,8 @@ When the markdown attribute is set to "span", the parser will force span behavio
111
110
112
111
The content of a span element is not parsed into block-level content. In other words, the content will not be rendered as paragraphs, headers, etc. Only inline syntax will be rendered, such as links, strong, emphasis, etc.
113
112
114
-
/// example | Forced "span" markdown parsing
113
+
:::: div example
114
+
**Example: Forced "span" markdown parsing**
115
115
116
116
```md
117
117
<divmarkdown="span">
@@ -127,14 +127,15 @@ renders as:
127
127
</div>
128
128
```
129
129
130
-
///
130
+
::::
131
131
132
132
133
133
## Nesting
134
134
135
135
When nesting multiple levels of raw HTML elements, a markdown attribute must be defined for each block-level element. For any block-level element that does not have a markdown attribute, everything inside that element is ignored, including child elements with markdown attributes.
0 commit comments