vitrine

Merge branch 'callout-gfm-aliases'. Sure. Whatever.

commit 9d8280db2ad7559dc99f511adc5f1cafdb827cd3 · parent 84ae9471ab · parent 8ef95cf289 · browse this tree
warpfork, 2026-08-09 16:08:46 UTC

diff --git a/README.md b/README.md
index c0317c0..48c71ee 100644
--- a/README.md
+++ b/README.md
@@ -86,7 +86,8 @@ The rendered box is `<div class="callout callout-{type}">`
 so docs authored for those tools render as intended).
 The styled types are `info`, `note`, `tip`, `success`, `todo`, `warning`, `danger`, and `reject`,
 each with its own accent color and icon; `info` and `note` ride the per-host accent.
-`warn` is accepted as an alias for `warning`.
+`warn` is accepted as an alias for `warning`,
+and the GitHub alert types `caution` and `important` map onto `warning` and `note`.
 An unknown type still renders as a plain neutral box.
 
 Callouts do not nest, by design,
diff --git a/callout.go b/callout.go
index 9d65fba..54bd329 100644
--- a/callout.go
+++ b/callout.go
@@ -36,11 +36,12 @@ type calloutNode struct {
 
 var kindCallout = ast.NewNodeKind("Callout")
 
-// calloutTypeAliases folds alternate type spellings onto the canonical set that
-// style.css styles.  Kept as a table because it is cheap to grow; for now it
-// just spells warn out in full.
+// calloutTypeAliases folds alternate spellings onto the canonical types that style.css styles:
+// warn abbreviates warning; caution and important are GitHub alert types with no canonical of their own.
 var calloutTypeAliases = map[string]string{
-	"warn": "warning",
+	"warn":      "warning",
+	"caution":   "warning",
+	"important": "note",
 }
 
 // canonicalCalloutType maps an author's type onto its canonical spelling,