Code snippets
Starlight enables Expressive Code by default — the same engine many teams expect from VS Code themes: titles, copy buttons, diffs, highlights, and terminal frames.
File titles and copy
Section titled “File titles and copy”export function userHasRequiredRoles( userRoles: string[], requiredRoles: string[] | undefined,): boolean { if (!requiredRoles?.length) return true; return requiredRoles.some((r) => userRoles.includes(r));}Insert / delete (changelog, migrations)
Section titled “Insert / delete (changelog, migrations)”{ "event": "asset.updated", "legacyId": "abc-123", "assetId": "550e8400-e29b-41d4-a716-446655440000", "timestamp": "2026-05-20T10:00:00Z"}Line highlights (focus reader attention)
Section titled “Line highlights (focus reader attention)”Example groups claim after sign-in (claim values for IAM setup: access matrix):
{ "sub": "user-uuid", "groups": [ "WIKIJS_CONNECT_CUSTOMER", "WIKIJS_SPACE_CUSTOMER" ], "azp": "astro-starlight"}Shell and ops runbooks
Section titled “Shell and ops runbooks”export PATH="/path/to/node/bin:$PATH"npm installnpm run dev$env:Path = "C:\path\to\node;$env:Path"npm installnpm run devConfig formats (SaaS staples)
Section titled “Config formats (SaaS staples)”services: docs: image: dih-docs:latest ports: - "4321:4321" environment: KEYCLOAK_ISSUER: https://iam.dev.dih-cloud.com/realms/developmentKEYCLOAK_CLIENT_ID=astro-starlightKEYCLOAK_CLIENT_SECRET=***PUBLIC_SITE_URL=http://localhost:4321GraphQL / SQL / HCL (multi-language portals)
Section titled “GraphQL / SQL / HCL (multi-language portals)”query Asset($id: ID!) { asset(id: $id) { id name policies { id type } }}When to use <Tabs> instead
Section titled “When to use <Tabs> instead”If the same procedure differs by language and readers switch often, prefer Starlight <Tabs> over long stacked code blocks.