Skip to content

Switch markdown conversion from Python-Markdown to cmark-gfm#13448

Merged
svgeesus merged 1 commit intomainfrom
gfm-admonitions
Feb 6, 2026
Merged

Switch markdown conversion from Python-Markdown to cmark-gfm#13448
svgeesus merged 1 commit intomainfrom
gfm-admonitions

Conversation

@sideshowbarker
Copy link
Member

@sideshowbarker sideshowbarker commented Feb 4, 2026

Switch from Python-Markdown to cmark-gfm for converting .md files to HTML. This gives full GFM rendering (tables, autolink, strikethrough, tasklists) using the same parser GitHub itself uses.

A post-processing step converts GFM alert syntax (> [!NOTE], > [!WARNING], etc.) into styled admonition blocks with color-coded borders — blue for note/tip, purple for important, red for warning/caution. This is the same approach GitHub takes: cmark-gfm renders them as blockquotes, then a post-processor converts them to alerts.

  • Replace pip install markdown markdown-gfm-admonition with apt install cmark-gfm + pip install bikeshed
  • Rewrite build-markdown.py to shell out to cmark-gfm instead of using the Python-Markdown library
  • Add regex-based admonition post-processing with CSS styling

Use cmark-gfm for full GFM rendering (tables, autolink, strikethrough,
tasklists), with a post-processing step that converts GFM alert syntax
(> [!NOTE], > [!WARNING], etc.) into styled admonition blocks.
@sideshowbarker sideshowbarker changed the title Support GFM admonitions in markdown-to-HTML conversion Switch markdown conversion from Python-Markdown to cmark-gfm Feb 4, 2026
@w3cbot

This comment was marked as resolved.

@svgeesus svgeesus merged commit 9c920ea into main Feb 6, 2026
1 check passed
@svgeesus svgeesus deleted the gfm-admonitions branch February 6, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants