mdformat-admon
An mdformat plugin for formatting python-markdown admonitions and rendering the associated HTML.
[!WARNING] This package used to support a set of helpers to build variations of admonition syntaxes and rendering the associated HTML, but that code has been moved to
mdformat-plugin-templatein the_synced/admon_factories/*.pydirectory.
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.18
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.0
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.0.tar.gz | 13.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mdformat_admon-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.7 kB
Release files / mdformat_admon-2.1.0.tar.gz
| Download URL | mdformat_admon-2.1.0.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9baf98c3ac82f497374ea45791e38fd85f6e2a86eb3c6fb1c6ae5bf46273e8aa
|
|
BLAKE2b-256 checksum How to use checksums |
2f13d2aad243119cf5d6ce685369da703e0a136d19b6841a3b9b0dfa1601d970
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|
Release files / mdformat_admon-2.1.0-py3-none-any.whl
| Download URL | mdformat_admon-2.1.0-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c22d92579b8ed591e02bb08cb7353adc48e58a5334c02824b81c081b5a583f9f
|
|
BLAKE2b-256 checksum How to use checksums |
8686aaa89161fd3164b2916f55ada43ba573d0d5c2098532a4d57780b5882508
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|