Repository navigation
astro: support Astro sites without Starlight, with an example site - #14
Merged
Merged
Conversation
Add `starlight-codeblocks/astro`, an Astro integration that adds Expressive Code with every feature to a site without Starlight. Code tabs and inline code highlighting are opt-in there, because they change every Markdown page, and unclaimed directives go back to their source text. `@astrojs/starlight` is now an optional peer dependency. Add a minimal example site in `examples/astro/`, built into the docs at `/examples/astro/`, and an "Astro without Starlight" docs page. Describe the package as a plugin for Starlight and Astro. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Move "Getting started" to install/starlight and "Astro without Starlight" to install/astro, with redirects from the old paths. The home page gets a button for each and a Starlight/Astro code tabs block for the install step. The notes on the code tabs and inline code highlighting pages move to the top. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Remove the install and the extend and reference sections, which the set-up buttons and the sidebar cover, and shorten the hero tagline. The code tabs page no longer points to the home page install command. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Adds first-class support for Astro sites that don't use Starlight, a hosted example site, and docs for both.
starlight-codeblocks/astrointegrationcodeblocks()returns[setup, astroExpressiveCode()]. Astro flattens the array, so Expressive Code sits where the author listscodeblocks(), beforemdx(). It replacesexpressiveCode()and takes its options underexpressiveCode.ec-configoverride for<Code>, Markdown plugin, bundled runtimes. Page CSS goes throughinjectScript('page-ssr')instead ofcustomCss.expressiveCode(), listsmdx()first, or has anec.config.mjspluginslist without the preset.index.tstointegration.ts; the Starlight plugin behaves as before.codeTabs: {}/inlineHighlighting: {}, because they change every Markdown page.restoreDirectives()plugin gives unclaimed directives back as their source text. Without it,16:9in prose renders as16.tabWidth: 0stays, as on Starlight.@astrojs/starlightis now an optional peer dependency, so plain Astro installs get no peer warning.astro-expressive-codeis a new optional peer dependency.examples/astro/<CodeWalkthrough>, styled like the docs (Starlight palette, Michroma, Night Owl, the homepage code block glow).pnpm docs:buildbuilds it intodocs/dist/examples/astro/, so it's hosted with the docs.pnpm testalso builds it as a smoke test.install/starlight("Starlight setup"), and a newinstall/astro("Astro setup") covers set-up, opt-in options, differences from Starlight and the Expressive Code-only route, plus a LinkCard to the hosted example. Redirects keep/getting-startedworking.AGENTS.mdandDECISIONS.mdare updated.<CodeWalkthrough>and<Scrollycoding>need Starlight: both work with onlyexpressiveCode()and the preset.test/astro.test.tscovers the integration and directive restoring.pnpm lint,pnpm lint:docs,pnpm testandpnpm docs:buildpass with no warnings.docs/dist: run code, code tabs, annotations, placeholders, API cards and the walkthrough, in light and dark themes.🤖 Generated with Claude Code