🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

markdown-gfm-admonition

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-gfm-admonition

GFM admonition syntax for Python Markdown

pipPyPI
Version
0.1.1
Maintainers
1

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"])

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts