Skip to content

satteriGitHubAlerts

Sätteri mdast plugin that turns GitHub alerts into Starlight asides.

The guides keep GitHub’s > [!TYPE] syntax because it also renders on GitHub, where most people read the repository. The site used to rely on starlight-github-alerts for the conversion, and on Starlight 0.42 that plugin silently does nothing: it registers itself in front of an mdast plugin NAMED starlight-asides, while Starlight now registers its asides as an unnamed factory, so the lookup misses and the plugin returns without a word. Every alert then rendered as a plain blockquote opening with the literal [!WARNING].

This plugin does the same conversion from the site’s own mdastPlugins, which run before every plugin Starlight appends: it replaces the blockquote with a containerDirective named after the aside variant, exactly what :::caution parses to, and Starlight’s own asides plugin then renders it.

Import:

import { satteriGitHubAlerts } from '@mnaoumov/typescript-dev-toolkit/docs-site/satteri-github-alerts';

Signature:

function satteriGitHubAlerts(): MdastPluginDefinition

Returns: MdastPluginDefinition — The plugin definition.