feat: add "Copy page" button for LLMs#1089
Open
PaulieB14 wants to merge 2 commits intographprotocol:mainfrom
Open
feat: add "Copy page" button for LLMs#1089PaulieB14 wants to merge 2 commits intographprotocol:mainfrom
PaulieB14 wants to merge 2 commits intographprotocol:mainfrom
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"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.