Skip to main content

MkDocs Pymdownx Material Extras

A plugin for MkDocs -- specifically the MkDocs Material Theme.

Adds additional resources that are used in the PyMdown Extensions documentation, and other @facelessuser projects.

While this is not specifically meant for outside consumption, and was originally written for @facelessuser projects, it can be freely used if desired.

Files are copied from the pymdown-extensions project.

Instructions

This is bound to specific versions of MkDocs Material and PyMdown Extensions. It may sometimes be tied to betas.

Installation:

pip install mkdocs_pymdownx_material_extras

Add it to your mkdocs.yml plugins. It is assuming you are using MkDocs Material. When doing so, remember to add back the search plugin as it doesn't append to the plugins, but overrides the plugins:

plugins:
  - search
  - mkdocs_pymdownx_material_extras

Setup your theme as follows:

theme:
  name: material # Must use Material theme
  custom_dir: docs/theme # If you have overrides, specify where to find them
  palette:
    scheme: dracula # This is how to enables the Dracula theme for dark. For light, it will use default Material with some tweaks.
    primary: deep purple # Primary colors
    accent: deep purple # accent color

The following Material primary/accent colors map to actual Dracula colors:

Material Dracula
red red
pink pink
purple purple
deep-purple purple
blue blue
indigo blue
light-blue blue
cyan cyan
teal cyan
green green
light-green green
lime green
yellow yellow
amber yellow
orange orange
deep-orange orange

Sponsor Footer Link

If you'd like to add the sponsor heart in the footer, add your sponsor link under the MkDocs theme options like so.

theme:
  pymdownx:
    sponsor: "https://github.com/sponsors/facelessuser"

Mermaid Support

Mermaid support is baked in. Simply add the Mermaid script to your MkDocs config:

extra_javascript:
  - https://cdn.jsdelivr.net/npm/mermaid@11.5.0/dist/mermaid.min.js

If you do not like our default setup, you are free to modify it. Simply provide a script file before before you include Mermaid with the new config:

extra_javascript:
  - my_mermaid_config.js
  - https://cdn.jsdelivr.net/npm/mermaid@11.5.0/dist/mermaid.min.js

Also, setup your Mermaid diagrams:

markdown_extensions:
  - pymdownx.superfences:
      custom_fences:
        # Mermaid diagrams
        - name: diagram
          class: diagram
          format: !!python/name:pymdownx.superfences.fence_code_format

Then you can specify your Mermaid diagrams in diagram code blocks:

```diagram
...
```

Mermaid setups are provided per scheme. You can see the setup here. if you are trying to override them.

MathJax/KaTeX

Again, MathJax and KaTeX support is baked in. Simply add the MathJax script(s) to your MkDocs config:

MathJax:

extra_javascript:
  - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

KaTeX:

extra_css:
  - https://cdn.jsdelivr.net/npm/katex@0.13.18/dist/katex.min.css

extra_javascript:
  - https://cdn.jsdelivr.net/npm/katex@0.13.18/dist/katex.min.js

Lastly, setup Arithmatex:

markdown_extensions:
  - pymdownx.arithmatex:
      generic: true # Must use generic mode
      block_tag: 'pre' # We wrap block math in `<pre>` to avoid issues with MkDocs minify HTML plugin: https://github.com/byrnereese/mkdocs-minify-plugin

If you do not like the default MathJax setup, add your own config before MathJax script:

extra_javascript:
  - my_mathjax_config.js
  - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

Release files for mkdocs-pymdownx-material-extras 2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocs-pymdownx-material-extras 2.8
File Size Uploaded
mkdocs_pymdownx_material_extras-2.8.tar.gz 26.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-pymdownx-material-extras 2.8
File Interpreter ABI Platform
mkdocs_pymdownx_material_extras-2.8-py3-none-any.whl Python 3 none any Details

Total release size: 55.4 kB

Release files / mkdocs_pymdownx_material_extras-2.8.tar.gz

Download URL mkdocs_pymdownx_material_extras-2.8.tar.gz
Size 26.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7b22bb119cd9592f98d6c6d4d269506d9a68d7038355c71525aadc88169ee9fe
BLAKE2b-256 checksum
How to use checksums
5ef65199d1e251e15b3c554f46b5796d02870e129f524dc2f117e828c5444674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / mkdocs_pymdownx_material_extras-2.8-py3-none-any.whl

Download URL mkdocs_pymdownx_material_extras-2.8-py3-none-any.whl
Size 28.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81b68789420c51b9b15514180d0f3ab7136d56ee512c830c998d2edb77ca3d77
BLAKE2b-256 checksum
How to use checksums
10780059cb24b62a3dd68293daea38acb2cb75415d5735a62d6d60f752cd00ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

2.8 This release

2 release files

2.7

2 release files

2.6

2 release files

2.5.6

2 release files

2.5.5

2 release files

2.5.4

2 release files

2.5.3

2 release files

2.5.2

2 release files

2.5.1

2 release files

2.5

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4

2 release files

2.3.1

2 release files

2.3

2 release files

2.2.1

2 release files

2.2

2 release files

2.1

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0

2 release files

1.6

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5

2 release files

1.4

2 release files

1.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2

1 release file

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page