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/docutils.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
@@ -35,6 +35,10 @@ The commands are based on the [Docutils Front-End Tools](https://docutils.source
35
35
```
36
36
:::
37
37
38
+
:::{versionadded} 0.19.0
39
+
`myst-suppress-warnings` replicates the functionality of sphinx's [`suppress_warnings`](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-suppress_warnings) for `myst.` warnings in the `docutils` CLI.
40
+
:::
41
+
38
42
The CLI commands can also utilise the [`docutils.conf` configuration file](https://docutils.sourceforge.io/docs/user/config.html) to configure the behaviour of the CLI commands. For example:
Adding `"smartquotes"` to `myst_enable_extensions` (in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)) will automatically convert standard quotations to their opening/closing variants:
57
+
Adding `"smartquotes"` to `myst_enable_extensions` (in the {{ confpy }}) will automatically convert standard quotations to their opening/closing variants:
57
58
58
59
-`'single quotes'`: 'single quotes'
59
60
-`"double quotes"`: "double quotes"
60
61
61
-
Adding `"replacements"` to `myst_enable_extensions` (in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)) will automatically convert some common typographic texts
62
+
Adding `"replacements"` to `myst_enable_extensions` (in the {{ confpy }}) will automatically convert some common typographic texts
62
63
63
64
text | converted
64
65
----- | ----------
@@ -95,7 +96,7 @@ and you will need to suppress the `myst.strikethrough` warning
95
96
(syntax/math)=
96
97
## Math shortcuts
97
98
98
-
Math is parsed by adding to the `myst_enable_extensions` list option, in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html) one or both of:
99
+
Math is parsed by adding to the `myst_enable_extensions` list option, in the {{ confpy }} one or both of:
99
100
100
101
-`"dollarmath"` for parsing of dollar `$` and `$$` encapsulated math.
101
102
-`"amsmath"` for direct parsing of [amsmath LaTeX environments](https://ctan.org/pkg/amsmath).
@@ -230,7 +231,7 @@ See [the extended syntax option](syntax/amsmath).
230
231
(syntax/mathjax)=
231
232
### Mathjax and math parsing
232
233
233
-
When building HTML using the [sphinx.ext.mathjax](https://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.mathjax) extension (enabled by default),
234
+
When building HTML using the {external+sphinx:mod}`sphinx.ext.mathjax <sphinx.ext.mathjax>` extension (enabled by default),
234
235
If `dollarmath` is enabled, Myst-Parser injects the `tex2jax_ignore` (MathJax v2) and `mathjax_ignore` (MathJax v3) classes in to the top-level section of each MyST document, and adds the following default MathJax configuration:
235
236
236
237
MathJax version 2 (see [the tex2jax preprocessor](https://docs.mathjax.org/en/v2.7-latest/options/preprocessors/tex2jax.html#configure-tex2jax):
@@ -252,7 +253,7 @@ To change this behaviour, set a custom regex, for identifying HTML classes to pr
252
253
(syntax/linkify)=
253
254
## Linkify
254
255
255
-
Adding `"linkify"` to `myst_enable_extensions` (in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)) will automatically identify "bare" web URLs and add hyperlinks:
256
+
Adding `"linkify"` to `myst_enable_extensions` (in the {{ confpy }}) will automatically identify "bare" web URLs and add hyperlinks:
256
257
257
258
`www.example.com` -> www.example.com
258
259
@@ -267,7 +268,7 @@ Either directly; `pip install linkify-it-py` or *via* `pip install myst-parser[l
267
268
268
269
## Substitutions (with Jinja2)
269
270
270
-
Adding `"substitution"` to `myst_enable_extensions` (in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)) will allow you to add substitutions, added in either the `conf.py` using `myst_substitutions`:
271
+
Adding `"substitution"` to `myst_enable_extensions` (in the {{ confpy }}) will allow you to add substitutions, added in either the `conf.py` using `myst_substitutions`:
271
272
272
273
```python
273
274
myst_substitutions = {
@@ -352,7 +353,7 @@ This may lead to unexpected outcomes.
352
353
353
354
:::
354
355
355
-
Substitution references are assessed as [Jinja2 expressions](http://jinja.palletsprojects.com) which can use [filters](https://jinja.palletsprojects.com/en/2.11.x/templates/#list-of-builtin-filters), and also contains the [Sphinx Environment](https://www.sphinx-doc.org/en/master/extdev/envapi.html) in the context (as `env`).
356
+
Substitution references are assessed as [Jinja2 expressions](http://jinja.palletsprojects.com) which can use [filters](https://jinja.palletsprojects.com/en/2.11.x/templates/#list-of-builtin-filters), and also contains the {external+sphinx:std:doc}`Sphinx Environment <extdev/envapi>` in the context (as `env`).
356
357
Therefore you can do things like:
357
358
358
359
```md
@@ -400,7 +401,7 @@ However, since Jinja2 substitutions allow for Python methods to be used, you can
400
401
401
402
## Code fences using colons
402
403
403
-
By adding `"colon_fence"` to `myst_enable_extensions` (in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)),
404
+
By adding `"colon_fence"` to `myst_enable_extensions` (in the {{ confpy }}),
404
405
you can also use `:::` delimiters to denote code fences, instead of ```` ``` ````.
405
406
406
407
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.
By adding `"deflist"` to `myst_enable_extensions` (in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)),
541
+
By adding `"deflist"` to `myst_enable_extensions` (in the {{ confpy }}),
541
542
you will be able to utilise definition lists.
542
543
Definition lists utilise the [markdown-it-py deflist plugin](markdown_it:md/plugins), which itself is based on the [Pandoc definition list specification](http://johnmacfarlane.net/pandoc/README.html#definition-lists).
543
544
@@ -616,7 +617,7 @@ Term 3
616
617
(syntax/tasklists)=
617
618
## Task Lists
618
619
619
-
By adding `"tasklist"` to `myst_enable_extensions` (in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)),
620
+
By adding `"tasklist"` to `myst_enable_extensions` (in the {{ confpy }}),
620
621
you will be able to utilise task lists.
621
622
Task lists utilise the [markdown-it-py tasklists plugin](markdown_it:md/plugins),
622
623
and are applied to markdown list items starting with `[ ]` or `[x]`:
@@ -725,7 +726,7 @@ Currently `sphinx.ext.autodoc` does not support MyST, see [](howto/autodoc).
725
726
(syntax/attributes)=
726
727
## Inline attributes
727
728
728
-
By adding `"attrs_inline"` to `myst_enable_extensions` (in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)),
729
+
By adding `"attrs_inline"` to `myst_enable_extensions` (in the {{ confpy }}),
729
730
you can enable parsing of inline attributes after certain inline syntaxes.
730
731
This is adapted from [djot inline attributes](https://htmlpreview.github.io/?https://github.com/jgm/djot/blob/master/doc/syntax.html#inline-attributes),
731
732
and also related to [pandoc bracketed spans](https://pandoc.org/MANUAL.html#extension-bracketed_spans).
@@ -844,7 +845,7 @@ This is usually a bad option, because the HTML is treated as raw text during the
844
845
845
846
HTML parsing to the rescue!
846
847
847
-
By adding `"html_image"` to `myst_enable_extensions` (in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)),
848
+
By adding `"html_image"` to `myst_enable_extensions` (in the {{ confpy }}),
848
849
MySt-Parser will attempt to convert any isolated `img` tags (i.e. not wrapped in any other HTML) to the internal representation used in sphinx.
By adding `"colon_fence"` to `myst_enable_extensions` (in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)),
870
+
By adding `"colon_fence"` to `myst_enable_extensions` (in the {{ confpy }}),
870
871
we can combine the above two extended syntaxes,
871
872
to create a fully Markdown compliant version of the `figure` directive named `figure-md`.
872
873
@@ -908,7 +909,7 @@ As we see here, the target we set can be referenced:
908
909
909
910
## HTML Admonitions
910
911
911
-
By adding `"html_admonition"` to `myst_enable_extensions` (in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)),
912
+
By adding `"html_admonition"` to `myst_enable_extensions` (in the {{ confpy }}),
912
913
you can enable parsing of `<div class="admonition">` HTML blocks.
913
914
These blocks will be converted internally to Sphinx admonition directives, and so will work correctly for all output formats.
914
915
This is helpful when you care about viewing the "source" Markdown, such as in Jupyter Notebooks.
@@ -974,7 +975,7 @@ You can also nest HTML admonitions:
974
975
975
976
## Direct LaTeX Math
976
977
977
-
By adding `"amsmath"` to `myst_enable_extensions` (in the sphinx `conf.py`[configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html)),
978
+
By adding `"amsmath"` to `myst_enable_extensions` (in the {{ confpy }}),
978
979
you can enable direct parsing of [amsmath](https://ctan.org/pkg/amsmath) LaTeX equations.
979
980
These top-level math environments will then be directly parsed:
Copy file name to clipboardExpand all lines: docs/syntax/roles-and-directives.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,12 @@
5
5
Roles and directives provide a way to extend the syntax of MyST in an unbound manner,
6
6
by interpreting a chuck of text as a specific type of markup, according to its name.
7
7
8
-
Mostly all [docutils roles](https://docutils.sourceforge.io/docs/ref/rst/roles.html), [docutils directives](https://docutils.sourceforge.io/docs/ref/rst/directives.html), [sphinx roles](https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html), or [sphinx directives](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html) can be used in MyST.
Copy file name to clipboardExpand all lines: docs/syntax/syntax.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ would be equivalent to:
85
85
### Setting HTML Metadata
86
86
87
87
The front-matter can contain the special key `html_meta`; a dict with data to add to the generated HTML as [`<meta>` elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta).
88
-
This is equivalent to using the [RST `meta` directive](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#html-metadata).
88
+
This is equivalent to using the {external+sphinx:ref}`meta directive <html-meta>`.
89
89
90
90
HTML metadata can also be added globally in the `conf.py`*via* the `myst_html_meta` variable, in which case it will be added to all MyST documents.
91
91
For each document, the `myst_html_meta` dict will be updated by the document level front-matter `html_meta`, with the front-matter taking precedence.
@@ -257,7 +257,8 @@ Target headers are defined with this syntax:
257
257
(header_target)=
258
258
```
259
259
260
-
They can then be referred to with the [ref inline role](https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-ref):
260
+
They can then be referred to with the
261
+
{external+sphinx:ref}`ref inline role <ref-role>`:
261
262
262
263
```md
263
264
{ref}`header_target`
@@ -277,7 +278,7 @@ Alternatively using the markdown syntax:
277
278
[my text](header_target)
278
279
```
279
280
280
-
is equivalent to using the [any inline role](https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-any):
281
+
is equivalent to using the {external+sphinx:ref}`any inline role <any-role>`:
0 commit comments