Skip to content

feat: add "Copy page" button for LLMs#1089

Open
PaulieB14 wants to merge 2 commits intographprotocol:mainfrom
PaulieB14:feature/copy-for-llm
Open

feat: add "Copy page" button for LLMs#1089
PaulieB14 wants to merge 2 commits intographprotocol:mainfrom
PaulieB14:feature/copy-for-llm

Conversation

@PaulieB14
Copy link
Copy Markdown

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

  • Copy page — fetches the raw .mdx source from GitHub and copies it to the clipboard as Markdown
  • View as Markdown ↗ — opens the raw GitHub file in a new tab

The button lives in content.tsx alongside the existing "Edit on GitHub" link, so it automatically appears on all doc pages without touching any individual .mdx files.

Changes

File What changed
website/src/components/CopyForLLM.tsx New component (button + dropdown)
website/src/components/index.ts Export the new component
website/src/layout/templates/default/content.tsx Derive rawMarkdownUrl and render <CopyForLLM> next to the edit link

Why 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":

[last updated date]          [Copy page ▾]  [✎ Edit this page]

Clicking "Copy page" copies the full Markdown source. The dropdown also exposes "View as Markdown ↗" for a direct link to the raw file.

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.
@PaulieB14 PaulieB14 requested a review from a team as a code owner April 1, 2026 02:31
- 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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant