Skip to main content

GFM admonition syntax for Python Markdown

Project description

markdown-gfm-admonition

PyPI GitHub Actions status

This package is an extension of Python Markdown that enables the admonition syntax of GitHub Flavored Markdown.

There are five types of admonitions:

> [!NOTE]
> Highlights information that users should take into account,
> even when skimming.

> [!TIP]
> Optional information to help a user be more successful.

> [!IMPORTANT]
> Crucial information necessary for users to succeed.

> [!WARNING]
> Critical content demanding immediate user attention due to potential risks.

> [!CAUTION]
> Negative potential consequences of an action.

It generates the same HTML as Python Markdown's built-in admonition extension:

<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Highlights information that users should take into account,
even when skimming.</p>
</div>

Usage

To use this extension, you need to install it first:

uv add markdown-gfm-admonition
# or
pip install markdown-gfm-admonition

Then, you can use it in your Python code like this:

from markdown import Markdown
from markdown_gfm_admonition import GfmAdmonitionExtension

md = Markdown(extensions=[GfmAdmonitionExtension()])
html = md.convert("""
> [!NOTE]
> Highlights information that users should take into account,
> even when skimming.
""")

[!TIP] Instead of importing GfmAdmonitionExtension directly, you can use the entry point "gfm_admonition" as well to load the extension:

md = Markdown(extensions=["gfm_admonition"])

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

markdown_gfm_admonition-0.3.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

markdown_gfm_admonition-0.3.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file markdown_gfm_admonition-0.3.0.tar.gz.

File metadata

  • Download URL: markdown_gfm_admonition-0.3.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for markdown_gfm_admonition-0.3.0.tar.gz
Algorithm Hash digest
SHA256 20a37febc79222badb6dfbfcbf0a74b94c0a6259b0f27e9f783601fea59094b6
MD5 6a9546cb2bee7e2f5b911529f009f734
BLAKE2b-256 595b1e7114e8fac6aadf2a25dab2e24a1eba54acd504d6a5747928a3eb09d7fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_gfm_admonition-0.3.0.tar.gz:

Publisher: build.yaml on dahlia/markdown-gfm-admonition

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_gfm_admonition-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for markdown_gfm_admonition-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e49bfea892f4c220b7f7b9479462360b69c68ae7cae7739e288b5382d0ae9b5
MD5 389d39294b996f50bd8cb9d607c5e27a
BLAKE2b-256 fc86ce4288122111c11bb2483a962357baa9793817d48ac1e99ce5ff47384efe

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_gfm_admonition-0.3.0-py3-none-any.whl:

Publisher: build.yaml on dahlia/markdown-gfm-admonition

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page