Skip to content

Add support for GitHub-style callouts (alerts)#26

Merged
llimllib merged 2 commits intomainfrom
callouts
Jan 23, 2026
Merged

Add support for GitHub-style callouts (alerts)#26
llimllib merged 2 commits intomainfrom
callouts

Conversation

@llimllib
Copy link
Copy Markdown
Owner

@llimllib llimllib commented Jan 23, 2026

Summary

Adds support for rendering GitHub Flavored Markdown callouts/alerts with colored terminal styling.

Callout Types

Type Color Icon
NOTE Blue
TIP Green 💡
IMPORTANT Purple
WARNING Yellow
CAUTION Red 🛑

Visual Design

Callouts are rendered with:

  • Colored vertical bar on the left side
  • Header line with icon and type name (bold + colored)
  • Wrapped content text with the colored bar prefix
image

Example

> [!NOTE]
> This is a helpful note for the reader.

Renders with a blue vertical bar and "ℹ Note" header.

Implementation

  • Added CalloutType enum with 5 variants
  • Added parse_callout_type() to detect [!TYPE] pattern
  • Added callout_style() to get icon, name, and ANSI color
  • Added format_callout() to render styled callouts
  • Modified format_blockquote() to detect and delegate to callout rendering

Tests

  • callout_note.toml - Basic NOTE callout test
  • callout_all_types.toml - All 5 callout types

Session transcript

Claude Code session transcript

Implement rendering of GitHub Flavored Markdown callouts/alerts with
colored styling:

- NOTE: Blue with ℹ icon
- TIP: Green with 💡 icon
- IMPORTANT: Purple with ❗ icon
- WARNING: Yellow with ⚠ icon
- CAUTION: Red with 🛑 icon

Callouts are rendered with a colored vertical bar on the left,
a header line with icon and type name, and wrapped content text.

Added CalloutType enum and helper methods:
- parse_callout_type() - detects [!TYPE] pattern in blockquotes
- callout_style() - returns icon, name, and ANSI color
- format_callout() - renders callout with styled header and content

Tests added for all callout types.
@llimllib llimllib merged commit 9effc80 into main Jan 23, 2026
3 checks passed
@llimllib llimllib deleted the callouts branch January 23, 2026 13:34
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.

1 participant