Skip to content

Add starlight-github-alerts extension for proper GitHub alert rendering in docs#760

Merged
pelikhan merged 3 commits intomainfrom
copilot/fix-2b493f32-599b-4688-a4f7-386d9aa00693
Sep 12, 2025
Merged

Add starlight-github-alerts extension for proper GitHub alert rendering in docs#760
pelikhan merged 3 commits intomainfrom
copilot/fix-2b493f32-599b-4688-a4f7-386d9aa00693

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 12, 2025

This PR adds the starlight-github-alerts extension to the documentation site to properly render GitHub-style alerts as styled Starlight aside components.

Problem

Previously, GitHub-style alerts like > [!TIP] and > [!CAUTION] were being rendered as plain blockquotes in the documentation, losing their visual impact and semantic meaning. For example:

> [!TIP]
> You can inspect the tools available for an Agentic Workflow by running
> `gh aw mcp-inspect <workflow-file>`

This would render as a plain blockquote without any special styling or indication that it was meant to be a tip.

Solution

Added the starlight-github-alerts npm package and configured it in the Astro/Starlight setup:

  1. Installed the extension: Added starlight-github-alerts as a dev dependency
  2. Updated configuration: Modified docs/astro.config.mjs to include the plugin in the Starlight plugins array
  3. Automatic conversion: The extension now converts GitHub-style alerts to proper Starlight aside components

Changes Made

  • docs/package.json: Added starlight-github-alerts dependency
  • docs/astro.config.mjs: Added the plugin to the Starlight configuration
  • docs/package-lock.json: Updated lockfile with new dependency

Visual Impact

The alerts now render with:

  • ✅ Proper visual styling with themed colors and borders
  • ✅ Appropriate icons (lightbulb for tips, warning triangle for cautions)
  • ✅ Semantic HTML with proper ARIA labels for accessibility
  • ✅ Support for all GitHub alert types: [!TIP], [!CAUTION], [!NOTE], [!IMPORTANT], [!WARNING]

Before: Plain blockquote text without styling
After: Styled alert boxes with icons that match GitHub's visual style

Screenshot showing the Security Notes page with a properly styled CAUTION alert that has a red/pink background, warning icon, and clear "Danger" label

The alerts now seamlessly integrate with the Starlight theme while maintaining the familiar GitHub alert styling that users expect.

Testing

  • ✅ Documentation builds successfully with the new extension
  • ✅ All existing GitHub alerts (TIP, CAUTION) render properly as styled aside components
  • ✅ Go project tests continue to pass
  • ✅ No breaking changes to existing functionality

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.contoso.com
    • Triggering command: /tmp/go-build2740652177/b278/cli.test -test.testlogfile=/tmp/go-build2740652177/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build1960199199/b278/cli.test -test.testlogfile=/tmp/go-build1960199199/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
  • telemetry.astro.build
    • Triggering command: node /home/REDACTED/work/gh-aw/gh-aw/docs/node_modules/.bin/astro build (dns block)
    • Triggering command: node /home/REDACTED/work/gh-aw/gh-aw/docs/node_modules/.bin/astro dev --port 3000 --host 0.0.0.0 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add the @HiDeoo/starlight-github-alerts extension to the docs so that it renders github alerts properly. Add starlight-github-alerts extension for proper GitHub alert rendering in docs Sep 12, 2025
Copilot AI requested a review from pelikhan September 12, 2025 04:30
@pelikhan pelikhan marked this pull request as ready for review September 12, 2025 04:35
@pelikhan pelikhan merged commit f200253 into main Sep 12, 2025
11 checks passed
@pelikhan pelikhan deleted the copilot/fix-2b493f32-599b-4688-a4f7-386d9aa00693 branch September 12, 2025 04:35
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.

2 participants