https://github.com/kyleking/mdformat-gfm-alerts
Format "GitHub Markdown Alerts," which use blockquotes to render admonitions
https://github.com/kyleking/mdformat-gfm-alerts
mdformat
Last synced: about 1 year ago
JSON representation
Format "GitHub Markdown Alerts," which use blockquotes to render admonitions
- Host: GitHub
- URL: https://github.com/kyleking/mdformat-gfm-alerts
- Owner: KyleKing
- License: mit
- Created: 2024-03-08T21:50:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-16T01:35:05.000Z (over 1 year ago)
- Last Synced: 2025-04-01T22:13:06.843Z (about 1 year ago)
- Topics: mdformat
- Language: Python
- Homepage:
- Size: 87.9 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# mdformat-gfm-alerts
[![Build Status][ci-badge]][ci-link] [![PyPI version][pypi-badge]][pypi-link]
An [mdformat](https://github.com/executablebooks/mdformat) plugin for ``
## `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](https://mdformat.readthedocs.io/en/stable/users/plugins.html)
### Pre-Commit
```yaml
repos:
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.18
hooks:
- id: mdformat
additional_dependencies:
- mdformat-gfm-alerts
```
### pipx/uv
```sh
pipx install mdformat
pipx inject mdformat mdformat-gfm-alerts
```
Or with uv:
```sh
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:
```py
from markdown_it import MarkdownIt
from mdformat_gfm_alerts.mdit_plugins import gfm_alerts_plugin
md = MarkdownIt()
md.use(gfm_alerts_plugin)
text = "... markdown example ..."
md.render(text)
#
#
#
```
## Contributing
See [CONTRIBUTING.md](https://github.com/kyleking/mdformat-gfm-alerts/blob/main/CONTRIBUTING.md)
[ci-badge]: https://github.com/kyleking/mdformat-gfm-alerts/workflows/CI/badge.svg?branch=main
[ci-link]: https://github.com/kyleking/mdformat-gfm-alerts/actions?query=workflow%3ACI+branch%3Amain+event%3Apush
[pypi-badge]: https://img.shields.io/pypi/v/mdformat-gfm-alerts.svg
[pypi-link]: https://pypi.org/project/mdformat-gfm-alerts