feat: Add AdmonitionExtension for semantic admonition markup#129
Merged
dereuromark merged 2 commits intomasterfrom Mar 26, 2026
Merged
feat: Add AdmonitionExtension for semantic admonition markup#129dereuromark merged 2 commits intomasterfrom
dereuromark merged 2 commits intomasterfrom
Conversation
Transforms divs with admonition type classes (note, tip, warning, danger, info, success, caution) into semantic HTML with: - Proper ARIA roles (role="note" or role="alert") - Auto-generated or custom titles - Collapsible blocks using details/summary - Configurable container/title classes and tags
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #129 +/- ##
============================================
+ Coverage 93.94% 93.97% +0.02%
- Complexity 2385 2419 +34
============================================
Files 81 83 +2
Lines 6310 6403 +93
============================================
+ Hits 5928 6017 +89
- Misses 382 386 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Documents the new AdmonitionExtension with examples for:
- Basic admonition syntax
- Custom titles via {title="..."} attribute
- Collapsible admonitions via {collapsible} and {collapsible=open}
- ARIA roles (note vs alert)
- Configuration options table
- Custom types, title tag customization, and disabling auto-titles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
AdmonitionExtensionthat transforms divs with admonition type classes into semantic HTML. Inspired by Python-Markdown/Material for MkDocs admonition syntax, but using djot's native fenced div syntax.Features
note,tip,warning,danger,info,success,cautionrole="note"orrole="alert"for warning types){title="Custom Title"}attribute{collapsible}or{collapsible=open}attributesUsage
Input/Output Examples
Basic admonition:
With custom title:
Collapsible: