Repository navigation
Conversation
Adds a "Copy page" button to the footer of every documentation page that lets users copy the page's raw Markdown to the clipboard — ideal for pasting into LLMs like Claude or ChatGPT. Also includes a "View as Markdown" option that links directly to the raw GitHub file for the current page. The button is placed in content.tsx alongside the existing "Edit on GitHub" link, so it automatically appears on all doc pages without touching individual MDX files.
- Wrap async copyMarkdown in void to fix @typescript-eslint/no-misused-promises - Run Prettier to fix class ordering and formatting in CopyForLLM.tsx and content.tsx"
…orts) The button advertised 'Copy page as Markdown for LLMs' but copied the raw .mdx source — YAML frontmatter, import statements, JSX. Add cleanMdxForLLM() to strip that noise so an agent gets clean prose+code, not page scaffolding.
|
👋 @brandonleekramer @benface — could I get a review on this one? It's mergeable and freshly updated. It adds a per-page "Copy page" button (copy-as-Markdown for LLMs + "view as Markdown") — the Stripe / Vercel / Anthropic-style affordance. It slots right into the AI / MCP / Skills direction from #1106 and #1105 and complements the existing
Happy to adjust to match your conventions — mostly just hoping to get it unstuck after it sat for a bit. 🙏 |
|
This seems like a practical idea. I'd approve. Chatting with Benoit about it. |
|
Thanks @PaulieB14, great idea! We’ve continued this in #NEW so we could make changes directly. It uses the Graph Design System components, keeps imports inside code examples, and fixes copying pages that come from other repos (like the graph-ts changelog). You’re credited as co-author on the commit. Closing in favor of #1134. |
What
Adds a "Copy page" button to the footer of every documentation page, letting users copy the page's raw Markdown to their clipboard — ideal for pasting directly into LLMs like Claude or ChatGPT.
Inspired by Notion's "Copy for LLM" feature.
How it works
.mdxsource from GitHub and copies it to the clipboard as MarkdownThe button lives in
content.tsxalongside the existing "Edit on GitHub" link, so it automatically appears on all doc pages without touching any individual.mdxfiles.Changes
website/src/components/CopyForLLM.tsxwebsite/src/components/index.tswebsite/src/layout/templates/default/content.tsxrawMarkdownUrland render<CopyForLLM>next to the edit linkWhy this is useful
The Graph docs cover complex protocol concepts — subgraphs, indexing, query architecture, etc. Developers frequently paste doc pages into LLMs to ask follow-up questions. This button removes the friction of manually copying, and since the source is already Markdown, no conversion is needed.
Screenshot / mockup
The button appears at the bottom of every page, to the left of "Edit on GitHub":
Clicking "Copy page" copies the full Markdown source. The dropdown also exposes "View as Markdown ↗" for a direct link to the raw file.