Format 'GitHub Markdown Alerts,' which use blockquotes to render admonitions
Maintained. Last release 4 months ago, commits in 3 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install mdformat-gfm-alertsmdformat-gfm-alerts
An mdformat plugin for GFM Alerts. For the JS markdown-it equivalent, see antfu/markdown-it-github-alerts
Scope
By default, this package targets the alert syntax GitHub itself renders: [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], and [!CAUTION] alone on their own line, per GitHub's alerts spec. Custom titles ([!TIP] Title) and fold indicators aren't part of that spec, so this package folds trailing text on the marker line into the alert body instead of treating it as a title, matching how GitHub itself would render it.
Obsidian's callout syntax (open-ended types, fold indicators, and custom titles) is where this convention originates. Hugo's alert syntax mirrors just the custom-title/fold grammar, restricted to GFM's five types. Pass --custom-title (or the custom_title option, see Configuration) to preserve an inline title on the canonical [!TYPE] line instead of folding it into the body. This package still won't support fold indicators or Obsidian's open-ended callout types. For that:
- mdformat-hugo bundles this package alongside Hugo-specific shortcode and markdown-attribute formatting
- mdformat-obsidian fully supports GFM-style alerts plus custom titles, folding, and Obsidian's open-ended callout types
Configuration
--custom-title (CLI), custom_title = true under (), or (API) preserves an inline custom title on the canonical line instead of folding it into the body: