Configuration
Plugin options
Section titled “Plugin options”Pass options to starlightCompass() in your Starlight configuration:
starlight({ plugins: [ starlightCompass({ audit: { failOn: "warning" }, devToolbar: true, provider: typesafe({ model: "jev-1.13.0" }), rules: [diataxis({ minConfidence: 0.7 })], }), ],});Type: object
Options for audits.
audit.failOn
Section titled “audit.failOn”Type: "error" | "warning" | "never"
Default: "error"
The lowest finding level that fails an audit. With "never", audits only report findings.
devToolbar
Section titled “devToolbar”Type: boolean
Default: true
Whether to add the Compass app to the Astro dev toolbar. The app is only added when the provider is configured.
provider
Section titled “provider”Type: CompassProvider
Default: typesafe()
The provider answering the questions of every rule. See Providers.
Type: CompassRule[]
Default: [diataxis()]
The rules reviewing every page. Setting this option replaces the default rules. See Rules.
Environment variables
Section titled “Environment variables”Compass reads environment variables from the shell and from .env, .env.local, .env.[mode] and .env.[mode].local files in the project root, like Vite. Variables set in the shell take precedence.
STARLIGHT_COMPASS_AUDIT
Section titled “STARLIGHT_COMPASS_AUDIT”Set to 1 or true to run an audit at the end of astro build. The build fails if the provider is not configured.
TYPESAFE_API_KEY
Section titled “TYPESAFE_API_KEY”The API key read by the typesafe() provider.
Frontmatter
Section titled “Frontmatter”Extend your docs schema with compassSchema() from starlight-compass/schema to add the following fields:
docsSchema({ extend: compassSchema() });diataxis
Section titled “diataxis”Type: "tutorial" | "how-to" | "reference" | "explanation" | false
The documentation type the page is meant to be, checked by the diataxis rule. Set it to false to skip the rule for this page.