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
Copy file name to clipboardExpand all lines: docs/syntax/admonitions.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,10 @@
3
3
Admonitions (also known as callouts) highlight a particular block of text,
4
4
that exists slightly apart from the narrative of your page, such as a note or a warning.
5
5
6
+
:::{seealso}
7
+
The [alert extension](syntax/alerts) provides GitHub-style alerts as a lightweight alternative syntax for admonitions.
8
+
:::
9
+
6
10
Admonitions are a special case of {{directive}} extensions.
7
11
It is advised to use admonitions with the [colon_fence](#syntax/colon_fence) extension, which signify that the content of the block is also MyST Markdown.
Copy file name to clipboardExpand all lines: docs/syntax/optional.md
+68Lines changed: 68 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,12 +28,14 @@ To enable all the syntaxes explained below:
28
28
29
29
```python
30
30
myst_enable_extensions = [
31
+
"alert",
31
32
"amsmath",
32
33
"attrs_inline",
33
34
"colon_fence",
34
35
"deflist",
35
36
"dollarmath",
36
37
"fieldlist",
38
+
"gfm_autolink",
37
39
"html_admonition",
38
40
"html_image",
39
41
"linkify",
@@ -89,6 +91,12 @@ text | converted
89
91
The `strikethrough` extension allows text within `~~` delimiters to have a strikethrough (horizontal line) placed over it.
90
92
For example, `~~strikethrough with *emphasis*~~` renders as: ~~strikethrough with *emphasis*~~.
91
93
94
+
```{versionadded} 5.1.0
95
+
`myst_strikethrough_single_tilde` option
96
+
```
97
+
98
+
To also allow single tilde delimiters (e.g. `~strikethrough~`), set `myst_strikethrough_single_tilde = True` in your {{ confpy }}.
99
+
92
100
:::{warning}
93
101
This extension is currently only supported for HTML output,
94
102
and you will need to suppress the `myst.strikethrough` warning
@@ -296,6 +304,27 @@ This extension requires that [linkify-it-py](https://github.com/tsutsu3/linkify-
296
304
Either directly; `pip install linkify-it-py` or *via*`pip install myst-parser[linkify]`.
297
305
:::
298
306
307
+
(syntax/gfm-autolink)=
308
+
## GFM Autolinks
309
+
310
+
```{versionadded} 5.1.0
311
+
```
312
+
313
+
Adding `"gfm_autolink"` to `myst_enable_extensions` (in the {{ confpy }}) will enable the [GitHub Flavored Markdown autolink extension](https://github.github.com/gfm/#autolinks-extension-).
314
+
This recognises bare `www.` URLs, `http(s)://` URLs, and email addresses, converting them to hyperlinks.
315
+
316
+
Unlike the `linkify` extension, `gfm_autolink` does **not** require any additional package to be installed.
317
+
It follows the GFM specification for determining URL boundaries.
318
+
319
+
:::{note}
320
+
`gfm_autolink` and `linkify` should not both be enabled at the same time, as they serve the same purpose with different matching algorithms.
321
+
322
+
Key differences:
323
+
324
+
-**`linkify`** matches schema-less domains (e.g. `example.com` with `fuzzy_link=True`), supports many protocols, and requires `linkify-it-py`.
325
+
-**`gfm_autolink`** only matches `www.`-prefixed URLs, `http(s)://`/`mailto:`/`xmpp:` URLs, and email addresses. It has no extra dependency and follows GFM URL boundary rules exactly.
326
+
:::
327
+
299
328
(syntax/substitutions)=
300
329
301
330
## Substitutions (with Jinja2)
@@ -412,6 +441,13 @@ you can also use `:::` delimiters to denote directives, instead of ```` ``` ````
412
441
Using colons instead of back-ticks has the benefit of allowing the content to be rendered correctly, when you are working in any standard Markdown editor.
413
442
It is ideal for admonition type directives (as documented in [Directives](syntax/directives)) or tables with titles, for example:
414
443
444
+
```{versionadded} 5.1.0
445
+
`myst_colon_fence_exact_match` option
446
+
```
447
+
448
+
By default, a closing colon fence with *at least* as many colons as the opening fence will close the block (matching the behaviour of backtick fences).
449
+
To require the closing fence to have *exactly* the same number of colons as the opening, set `myst_colon_fence_exact_match = True` in your {{ confpy }}.
450
+
415
451
:::::{myst-example}
416
452
417
453
:::{note}
@@ -590,6 +626,38 @@ and are applied to markdown list items starting with `[ ]` or `[x]`:
590
626
-[x] An item that is complete
591
627
:::
592
628
629
+
(syntax/alerts)=
630
+
## Alerts (GitHub-style callouts)
631
+
632
+
```{versionadded} 5.1.0
633
+
```
634
+
635
+
By adding `"alert"` to `myst_enable_extensions` (in the {{ confpy }}),
636
+
you can use [GitHub-style alerts](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts) (also known as callouts).
637
+
These are rendered as admonition nodes in the output.
638
+
639
+
The syntax is a blockquote beginning with a special marker like `[!NOTE]`:
640
+
641
+
:::{myst-example}
642
+
> [!NOTE]
643
+
> This is a note alert.
644
+
645
+
> [!TIP]
646
+
> This is a tip alert.
647
+
648
+
> [!IMPORTANT]
649
+
> This is an important alert.
650
+
651
+
> [!WARNING]
652
+
> This is a warning alert.
653
+
654
+
> [!CAUTION]
655
+
> This is a caution alert.
656
+
:::
657
+
658
+
The five supported alert types map to the following docutils admonition nodes:
659
+
`NOTE`, `TIP`, `IMPORTANT`, `WARNING`, and `CAUTION`.
0 commit comments