Contextual menu
Setting contextMenu in writedocs.json turns on two things together: a “Copy page” dropdown next to every eligible page’s <h1>, and a raw-Markdown route for every page, served at that page’s own URL with .md appended instead of a trailing slash (/guides/webhooks/ → /guides/webhooks.md). Both are off entirely — no dropdown, no .md routes — on a site that doesn’t set this field.
Enabling it
{
"contextMenu": {}
}That’s enough on its own — every field has a default. The empty object turns on the dropdown with “Copy page” and “View as Markdown” always present, plus all three “Open in…” assistant links (though see below — those three additionally need domain set to actually appear).
openIn
{
"contextMenu": {
"openIn": ["chatgpt", "claude"]
}
}Controls which “Open in…” links appear, in the order listed. Each one opens the assistant with a prompt pointing at this page’s own .md URL, so the assistant fetches the current content rather than a snapshot baked into the link.
The “Open in…” links need an absolute URL to hand the assistant — they don’t render at all on a site with no top-level domain set (see SEO and sitemap), regardless of what openIn lists. “Copy page” and “View as Markdown” don’t have this restriction — they work against the current page’s own relative .md route either way.
What the dropdown offers
- Copy page — copies the page’s raw Markdown source to the clipboard, for pasting into any AI tool as context.
- View as Markdown — opens the page’s
.mdroute directly. - Open in ChatGPT / Claude / Perplexity — opens the assistant with a prompt pointing at this page’s
.mdURL, so it can fetch the content and answer questions about it. Only the ones listed inopenIn, and only whendomainis set (see above).
Where it appears
The dropdown renders next to the page’s auto-generated <h1> — which means it’s only shown on pages that have one. It’s hidden on:
mode: customandmode: blankpages — see Page modes. These render no auto<h1>at all (a hand-built canvas page controls its own layout), so there’s nothing for the dropdown to sit next to.- OpenAPI operation pages — these render almost entirely from the spec at request time rather than from prose, so there’s no meaningful Markdown “page” for the dropdown to copy in the first place.
The underlying .md route, unlike the dropdown, is still generated for every page regardless of mode — a mode: custom page is still reachable at its own .md URL, just without a menu pointing at it. OpenAPI operation pages are the one exception to that too — they’re excluded from the .md routes entirely, for the same near-empty-content reason the dropdown skips them.
See docs.json-examples/00-kitchen-sink/ in the Writedocs repo for a complete, buildable example — ordinary pages get the dropdown, and about.mdx (mode: custom) doesn’t, since there’s no auto <h1> for it to sit next to.