Skip to content

Agent Markdown

sentryAgentMarkdown() generates Markdown versions of Starlight docs pages and adds a Markdown copy action to the table of contents.

astro.config.mjs
import starlight from "@astrojs/starlight";
import sentryStarlightTheme, {
monochromeCodeTheme,
sentryAgentMarkdown,
} from "@sentry/starlight-theme";
import { defineConfig } from "astro/config";
export default defineConfig({
integrations: [
starlight({
title: "My Sentry project",
plugins: [sentryStarlightTheme(), sentryAgentMarkdown()],
}),
],
markdown: {
shikiConfig: {
theme: monochromeCodeTheme,
},
},
});
markdownRoutesboolean

Generate static .md routes. Defaults to true.

markdownActionsboolean

Add a Markdown copy action below the right-sidebar table of contents. Defaults to true.

navigationboolean

Append child-page navigation to generated Markdown pages. Defaults to true.

contentNegotiationboolean

Serve Markdown from normal docs URLs when SSR requests prefer Markdown. Defaults to false.

agent-markdown-options.js
sentryAgentMarkdown({
contentNegotiation: true,
markdownActions: false,
});
  • /index.md for the root docs page.
  • /<slug>.md for every other docs page.
  • Non-root pages get a Navigation section with docs-home and previous/next sibling links.
  • Nested pages also get a parent link.
  • Pages with visible child pages also get a Pages in this section list.
  • Draft, hidden, and versioned pages are omitted from generated navigation.

The sandbox includes rendered HTML patterns that should produce readable Markdown:

  • api-link-card grids become Markdown lists.
  • sentry-key-value-list definition lists become compact bullet lists.
  • Expressive Code blocks preserve line breaks and language fences.
  • Starlight heading anchors do not leak screen-reader labels into Markdown.