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
Metadata
Release files for mdformat_admon 2.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mdformat_admon-2.1.1.tar.gz | 13.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mdformat_admon-2.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.3 kB
Release files / mdformat_admon-2.1.1.tar.gz
| Download URL | mdformat_admon-2.1.1.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
605df53bec06eba63f0ad510f7f67cdead9c328ec807bca1db76026a66a68d9e
|
|
BLAKE2b-256 checksum How to use checksums |
cb425188f91e20ef1c563b4feb687f300c9ff4d16b4105dd94aab61bda8e3cef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|
Release files / mdformat_admon-2.1.1-py3-none-any.whl
| Download URL | mdformat_admon-2.1.1-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2efae84da6d4eaa453a7cf0eca7437dc1c1e347a0780abfa5eecfdda03630c2
|
|
BLAKE2b-256 checksum How to use checksums |
9e0d1d9a3a59295ce2236bec57a90a32a81bb268aad03e1daa3b40db7e9f44a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|