Skip to main content

An mdformat plugin for `gfm_alerts`.

Project description

mdformat-gfm-alerts

Build Status PyPI version

An mdformat plugin for GFM Alerts

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.19
    hooks:
      - id: mdformat
        additional_dependencies:
          - mdformat-gfm-alerts

pipx/uv

pipx install mdformat
pipx inject mdformat mdformat-gfm-alerts

Or with uv:

uv tool run --from mdformat-gfm-alerts mdformat

HTML Rendering

To generate HTML output, gfm_alerts_plugin can be imported from mdit_plugins. 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_gfm_alerts.mdit_plugins import gfm_alerts_plugin

md = MarkdownIt()
md.use(gfm_alerts_plugin)

text = """
> [!WARNING]
> This is the warning text
"""
md.render(text)
# <div class="markdown-alert markdown-alert-warning">
# <p class="markdown-alert-title">Warning</p>
# <p>This is the warning text</p>
# </div>

Contributing

See CONTRIBUTING.md

Project details


Download files

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

Source Distribution

mdformat_gfm_alerts-2.0.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

mdformat_gfm_alerts-2.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file mdformat_gfm_alerts-2.0.0.tar.gz.

File metadata

  • Download URL: mdformat_gfm_alerts-2.0.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for mdformat_gfm_alerts-2.0.0.tar.gz
Algorithm Hash digest
SHA256 eb2b3189ad44ae28a6b6b714609dd3a30d6e3b898f02b1e6473d7b08df8bb3c0
MD5 205ecce77d1f617357ff0b422c44b3c2
BLAKE2b-256 c73370619cf9e2b9e35857ebcf7e947e8f5370df2ff2a4ab666895783f8fab6c

See more details on using hashes here.

File details

Details for the file mdformat_gfm_alerts-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mdformat_gfm_alerts-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e003422cc003bc6e936d0797553f23201095a1d1e8602c5062296d223f2ae516
MD5 5ff93f616fcc6d03a41c54ae3a193f33
BLAKE2b-256 89ea22e093bb2ef3e25dc3ccc9d8392c14b069a007ae394a12e058d9e1f51c00

See more details on using hashes here.

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