An mdformat plugin for `admonition`.
Project description
mdformat-admon
An mdformat plugin for formatting python-markdown admonitions and rendering the associated HTML.
[!WARNING]
mdformat-admonandmdformat-mkdocs>=4.0.0are no longer compatible. If you have both, you'll want to removemdformat-admonThe stylistic formatting for
mkdocsdiffers from Python Markdown (#22), so this package is now only for Python Markdown without mkdocs.
mdformat Usage
Add this package wherever you use mdformat and the plugin will be auto-recognized. No additional configuration necessary. See additional information on mdformat plugins here
Pre-Commit
repos:
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.19
hooks:
- id: mdformat
additional_dependencies:
- mdformat-admon
pipx/uv
pipx install mdformat
pipx inject mdformat mdformat-admon
Or with uv:
uv tool run --from mdformat-admon mdformat
HTML Rendering
To generate HTML output, python_markdown_admon_plugin can be imported from mdit_plugins. More plugins will be added in the future. For more guidance on MarkdownIt, see the docs: https://markdown-it-py.readthedocs.io/en/latest/using.html#the-parser
from markdown_it import MarkdownIt
from mdformat_admon.mdit_plugins import python_markdown_admon_plugin
md = MarkdownIt()
md.use(python_markdown_admon_plugin)
text = '!!! note ""\n *content*'
md.render(text)
# <div class="admonition note">
# <p><em>content</em></p>
# </div>
Contributing
See CONTRIBUTING.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdformat_admon-2.1.1.tar.gz.
File metadata
- Download URL: mdformat_admon-2.1.1.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
605df53bec06eba63f0ad510f7f67cdead9c328ec807bca1db76026a66a68d9e
|
|
| MD5 |
e662320d9a3849759a532d3316d01deb
|
|
| BLAKE2b-256 |
cb425188f91e20ef1c563b4feb687f300c9ff4d16b4105dd94aab61bda8e3cef
|
File details
Details for the file mdformat_admon-2.1.1-py3-none-any.whl.
File metadata
- Download URL: mdformat_admon-2.1.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2efae84da6d4eaa453a7cf0eca7437dc1c1e347a0780abfa5eecfdda03630c2
|
|
| MD5 |
860031a5583c7b23a1dd72ca4d3e8607
|
|
| BLAKE2b-256 |
9e0d1d9a3a59295ce2236bec57a90a32a81bb268aad03e1daa3b40db7e9f44a7
|