Markdown Actions
Configure the "Copy page" feature with AI agents and per-page overrides.
The theme includes a “Copy page” button next to each documentation page title, with a dropdown to open the current page in various AI agents. This feature is enabled by default and can be configured globally or per-page.
Global Configuration
Section titled “Global Configuration”All markdown actions settings live under the docs key in the plugin config:
import starlight from '@astrojs/starlight'import { defineConfig } from 'astro/config'import starlightThemeBlack from 'starlight-theme-black'
export default defineConfig({ integrations: [ starlight({ plugins: [ starlightThemeBlack({ docs: { showMarkdownActions: { prompt: 'I\'m looking at this documentation: {url}. Help me understand it.', agents: { chatgpt: true, claude: true, v0: true, scira: true, }, }, }, }), ], }), ],})Built-in Agents
Section titled “Built-in Agents”The theme includes 4 agents by default:
| ID | Label | URL |
|---|---|---|
chatgpt |
Open in ChatGPT | https://chatgpt.com?q={prompt} |
v0 |
Open in v0 | https://v0.dev?q={prompt} |
claude |
Open in Claude | https://claude.ai/new?q={prompt} |
scira |
Open in Scira | https://scira.ai/?q={prompt} |
Adding Custom Agents
Section titled “Adding Custom Agents”Add new agents with a unique key:
starlightThemeBlack({ docs: { showMarkdownActions: { agents: { // Use built-in defaults chatgpt: true,
// Add custom agent perplexity: { label: 'Ask Perplexity', url: 'https://perplexity.ai/search?q={prompt}', prompt: 'Explain this documentation: {url}', icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">...</svg>', }, }, }, },})Agent Options
Section titled “Agent Options”Each agent object supports:
| Property | Type | Description |
|---|---|---|
label |
string |
Display name in the dropdown. |
url |
string |
Service URL. Use {prompt} as placeholder for the encoded prompt. |
prompt |
string |
Prompt template. Use {url} as placeholder for the page URL. |
icon |
string |
SVG string rendered next to the label. Built-in agents have their own icons. |
Frontmatter Configuration
Section titled “Frontmatter Configuration”Override the global config per-page using frontmatter:
---title: My PageshowMarkdownActions: false # Disable on this page---
---
title: My PageshowMarkdownActions:agents:chatgpt: true # Keep enabledclaude: false # Disable on this pagev0:prompt: 'Custom prompt for this page at {url}' # Override prompt
---Frontmatter Schema
Section titled “Frontmatter Schema”| Property | Type | Description |
|---|---|---|
showMarkdownActions |
boolean | { prompt?, agents? } |
Enable/disable or customize per-page |
Merging Logic
Section titled “Merging Logic”- Built-in agents (chatgpt, v0, claude, scira) are loaded as defaults
- Global config agents override/add to defaults
- Frontmatter agents override the merged result:
false→ remove agenttrue→ keep as-is{ ... }→ merge (frontmatter wins)
Prompt resolution (per agent):
- Frontmatter agent-specific
prompt - Global agent-specific
prompt - Frontmatter root
prompt - Global root
prompt - Hardcoded default
Examples
Section titled “Examples”Disable all agents except ChatGPT
Section titled “Disable all agents except ChatGPT”starlightThemeBlack({ docs: { showMarkdownActions: { agents: { chatgpt: true, v0: false, claude: false, scira: false, }, }, },})Custom prompt for all agents
Section titled “Custom prompt for all agents”starlightThemeBlack({ docs: { showMarkdownActions: { prompt: 'Explain the API reference at {url} with code examples.', }, },})Disable globally
Section titled “Disable globally”starlightThemeBlack({ docs: { showMarkdownActions: false, },})Disable on specific page
Section titled “Disable on specific page”---title: Internal NotesshowMarkdownActions: false---Overriding the component
Section titled “Overriding the component”For full control, override the PageTitle component via Starlight’s component override system:
starlight({ components: { PageTitle: './src/components/MyPageTitle.astro', },})Refer to the Starlight overrides guide for details.