Metadata-Version: 2.4
Name: markdown-gfm-admonition
Version: 0.2.0
Summary: GFM admonition syntax for Python Markdown
Author-email: Hong Minhee <hong@minhee.org>
License-Expression: LGPL-3.0-or-later
Project-URL: Repository, https://github.com/dahlia/markdown-gfm-admonition
Project-URL: Issue Tracker, https://github.com/dahlia/markdown-gfm-admonition/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Filters
Classifier: Topic :: Text Processing :: Markup :: HTML
Classifier: Topic :: Text Processing :: Markup :: Markdown
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Markdown>=3.2
Dynamic: license-file

markdown-gfm-admonition
=======================

[![PyPI][PyPI badge]][PyPI]
[![GitHub Actions status][GitHub Actions status badge]][GitHub Actions status]

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

There are five types of admonitions:

~~~~ markdown
> [!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][2]:

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

[PyPI badge]: https://img.shields.io/pypi/v/markdown-gfm-admonition
[PyPI]: https://pypi.org/project/markdown-gfm-admonition/
[GitHub Actions status badge]: https://github.com/dahlia/markdown-gfm-admonition/actions/workflows/build.yaml/badge.svg
[GitHub Actions status]: https://github.com/dahlia/markdown-gfm-admonition/actions/workflows/build.yaml
[Python Markdown]: https://github.com/Python-Markdown/markdown
[1]: https://github.com/orgs/community/discussions/16925
[2]: https://python-markdown.github.io/extensions/admonition/


Usage
-----

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

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

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

~~~~ python
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:
>
> ~~~~ python
> md = Markdown(extensions=["gfm_admonition"])
> ~~~~
