Skip to main content

mdformat-admon

Build Status PyPI version

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-template in the _synced/admon_factories/*.py directory.

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)

Source distribution for mdformat_admon 2.1.0
File Size Uploaded
mdformat_admon-2.1.0.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mdformat_admon 2.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

2.1.1

2 release files

This release

2.1.0 This release

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.1

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