PyMarkdown Extensions

PyMarkdown extensions contain a wide selection of extensions to the markdown syntax. Below are list of tested features, along with short demonstrations of their setup and usage.

Math equation

Following the pymdownx documentation, you can include math equations by adding the extra javascript (mathjax or katex). The following example uses mathjax:

extra_javascript:
  - js/mathjax.js
  - https://polyfill.io/v3/polyfill.min.js?features=es6
  - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
window.MathJax = {
    tex: {
      inlineMath: [["\\(", "\\)"]],
      displayMath: [["\\[", "\\]"]],
      processEscapes: true,
      processEnvironments: true
    },
    options: {
      ignoreHtmlClass: ".*|",
      processHtmlClass: "arithmatex"
    }
};
$$
-\mathbf{J} =\boldsymbol{\Omega} \mathbf{X}
$$
\[-\mathbf{J} =\boldsymbol{\Omega} \mathbf{X}\]

Code highlight

markdown_extensions:
  - pymdownx.superfences
  - pymdownx.highlight
```python
import numpy as np

J = - np.einsum('ij,jk->ik', Omega, X)
```
import numpy as np

J = - np.einsum('ij,jk->ik', Omega, X)

Task Lists

markdown_extensions:
  - pymdownx.tasklist:
      custom_checkbox: true
      clickable_checkbox: true
- [X] item 1
    * [X] item A
    * [ ] item B
        more text
        + [x] item a
        + [ ] item b
        + [x] item c
    * [X] item C
- [ ] item 2
- [ ] item 3
  • item 1
    • item A
    • item B more text
      • item a
      • item b
      • item c
    • item C
  • item 2
  • item 3

Details

Details (collapsable boxes) are supported by the details plugin, the coloring scheme is the same as admonitons.

markdown_extensions:
  - pymdownx.details
???+ Note "Click me to close"

    Nagging.

---

??? Warning "Click me to open"

    Superise.
Click me to close

Nagging.


Click me to open

Surprise.

« Previous
Next »