|
2 | 2 |
|
3 | 3 | # Plugin extensions |
4 | 4 |
|
5 | | -The following plugins are embedded within the core package (enabled when using the `"default"` preset configuration): |
| 5 | +The following plugins are embedded within the core package: |
6 | 6 |
|
7 | 7 | - [tables](https://help.github.com/articles/organizing-information-with-tables/) (GFM) |
8 | 8 | - [strikethrough](https://help.github.com/articles/basic-writing-and-formatting-syntax/#styling-text) (GFM) |
9 | 9 |
|
10 | | -Other plugins are then available *via* the [`mdit_py_plugins`](https://github.com/executablebooks/mdit-py-plugins). |
| 10 | +These can be enabled individually: |
11 | 11 |
|
12 | | -```{important} |
13 | | -``markdown_it.extensions`` is now deprecated and plugins have been moved to |
14 | | -[`mdit_py_plugins`](https://github.com/executablebooks/mdit-py-plugins) |
| 12 | +```python |
| 13 | +from markdown_it import MarkdownIt |
| 14 | +md = MarkdownIt("commonmark").enable('table') |
15 | 15 | ``` |
16 | 16 |
|
17 | | -They can be chained and loaded *via*: |
| 17 | +or as part of a configuration: |
18 | 18 |
|
19 | 19 | ```python |
20 | 20 | from markdown_it import MarkdownIt |
21 | | -from mdit_py_plugins import plugin1, plugin2 |
22 | | -md = MarkdownIt().use(plugin1, keyword=value).use(plugin2, keyword=value) |
23 | | -html_string = md.render("some *Markdown*") |
| 21 | +md = MarkdownIt("gfm-like") |
24 | 22 | ``` |
25 | 23 |
|
26 | | -```{eval-rst} |
27 | | -.. autofunction:: mdit_py_plugins.anchors.anchors_plugin |
28 | | - :noindex: |
29 | | -
|
30 | | -.. autofunction:: mdit_py_plugins.footnote.footnote_plugin |
31 | | - :noindex: |
32 | | -
|
33 | | -.. autofunction:: mdit_py_plugins.front_matter.front_matter_plugin |
34 | | - :noindex: |
| 24 | +```{seealso} |
| 25 | +See [](using.md) |
| 26 | +``` |
35 | 27 |
|
36 | | -.. autofunction:: mdit_py_plugins.container.container_plugin |
37 | | - :noindex: |
| 28 | +Many other plugins are then available *via* the `mdit-py-plugins` package, including: |
38 | 29 |
|
39 | | -.. autofunction:: mdit_py_plugins.deflist.deflist_plugin |
40 | | - :noindex: |
| 30 | +- Front-matter |
| 31 | +- Footnotes |
| 32 | +- Definition lists |
| 33 | +- Task lists |
| 34 | +- Heading anchors |
| 35 | +- LaTeX math |
| 36 | +- Containers |
| 37 | +- Word count |
41 | 38 |
|
42 | | -.. autofunction:: mdit_py_plugins.texmath.texmath_plugin |
43 | | - :noindex: |
| 39 | +For full information see: <https://mdit-py-plugins.readthedocs.io> |
44 | 40 |
|
45 | | -.. autofunction:: mdit_py_plugins.dollarmath.dollarmath_plugin |
46 | | - :noindex: |
| 41 | +Or you can write them yourself! |
47 | 42 |
|
48 | | -.. autofunction:: mdit_py_plugins.amsmath.amsmath_plugin |
49 | | - :noindex: |
| 43 | +They can be chained and loaded *via*: |
50 | 44 |
|
51 | | -.. autofunction:: mdit_py_plugins.tasklists.tasklists_plugin |
52 | | - :noindex: |
| 45 | +```python |
| 46 | +from markdown_it import MarkdownIt |
| 47 | +from mdit_py_plugins import plugin1, plugin2 |
| 48 | +md = MarkdownIt().use(plugin1, keyword=value).use(plugin2, keyword=value) |
| 49 | +html_string = md.render("some *Markdown*") |
53 | 50 | ``` |
54 | | - |
55 | | -`myst_blocks` and `myst_role` plugins are also available, for utilisation by the [MyST renderer](https://myst-parser.readthedocs.io/en/latest/using/syntax.html) |
56 | | - |
57 | | -There are also many other plugins which could easily be ported (and hopefully will be): |
58 | | - |
59 | | -- [subscript](https://github.com/markdown-it/markdown-it-sub) |
60 | | -- [superscript](https://github.com/markdown-it/markdown-it-sup) |
61 | | -- [abbreviation](https://github.com/markdown-it/markdown-it-abbr) |
62 | | -- [emoji](https://github.com/markdown-it/markdown-it-emoji) |
63 | | -- [insert](https://github.com/markdown-it/markdown-it-ins) |
64 | | -- [mark](https://github.com/markdown-it/markdown-it-mark) |
65 | | -- ... and [others](https://www.npmjs.org/browse/keyword/markdown-it-plugin) |
0 commit comments