Skip to content

Getting Started

starlight-md-txt is a community Starlight plugin to expose your documentation pages as raw, agent-friendly Markdown (e.g. /getting-started.md).

This is designed to help AI agents, LLMs, and search crawlers easily consume your documentation in a structured, clean format without navigation headers, footers, script code, or CSS wrappers.

Install the plugin using your package manager:

Terminal window
npm install starlight-md-txt

Add the plugin to your astro.config.mjs within the starlight integrations configuration:

astro.config.mjs
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import starlightMdTxt from 'starlight-md-txt';
export default defineConfig({
site: 'https://your-site.com',
integrations: [
starlight({
title: 'My Documentation',
plugins: [
starlightMdTxt({
// Optional options go here
includeDrafts: false,
format: '.md', // '.md' (default) or '.md.txt'
}),
],
}),
],
});

Now, when you run your build, all of your documentation pages will have a corresponding .md file (e.g., dist/getting-started.md) alongside the standard HTML pages.