Skip to content

Add docusaurus-plugin-copy-page-button#433

Closed
portdeveloper wants to merge 1 commit into
fastify:mainfrom
portdeveloper:add-copy-page-button
Closed

Add docusaurus-plugin-copy-page-button#433
portdeveloper wants to merge 1 commit into
fastify:mainfrom
portdeveloper:add-copy-page-button

Conversation

@portdeveloper
Copy link
Copy Markdown

Summary

Adds docusaurus-plugin-copy-page-button to the Fastify website so readers can copy any documentation page as clean markdown — useful when piping plugin docs, hooks, or route options into ChatGPT, Claude, Perplexity, or Gemini.

The plugin auto-injects a small "Copy page" button + dropdown into the doc page's table-of-contents area. The dropdown offers:

  • Copy as markdown
  • View as markdown
  • Open in ChatGPT / Claude / Perplexity / Gemini

Live preview of the UI: https://portdeveloper.github.io/copy-page-button-showcase/

Relationship to existing llms.txt

The website already runs @signalwire/docusaurus-plugin-llms-txt to generate /llms.txt and /llms-full.txt at build time — great for whole-corpus consumption. This PR doesn't replace or duplicate that. The plugin adds the UI affordance: a reader on a specific page can grab just that page's markdown, or one-click open it in an AI tool, without going through the corpus index.

Adoption

The plugin currently ships on docs sites for React Native (just merged via facebook/react-native-website#5085), Puppeteer, Arbitrum, Cardano, Sui, Ethereum execution-apis, and several others — full list in the project README.

Changes

  • Added 'docusaurus-plugin-copy-page-button' to the plugins array in docusaurus.config.js
  • Added docusaurus-plugin-copy-page-button@^0.6.2 to dependencies
  • Resulting package-lock.json updates

Notes

  • package-lock.json shows incidental "libc" field removals on a handful of optional native deps. That's npm 10.9.8 (what I ran with) normalizing keys differently from the lockfile's original generator; happy to regenerate with a specific npm version if maintainers want a cleaner diff.
  • I did not run the full scripts/build-website.sh locally — it downloads Fastify release artifacts to generate versions.json. The plugin add is a single string in the plugins array, identical to the pattern landed in 4 sibling PRs (Jellyfin, Seeed Studio Wiki, PlayCanvas Developer, Temporal) where the full build was verified.

@portdeveloper
Copy link
Copy Markdown
Author

On reflection, I think this overlaps too much with what Fastify already ships — between @signalwire/docusaurus-plugin-llms-txt generating /llms.txt + /llms-full.txt and the per-page .md URL routes (e.g. https://fastify.dev/docs/latest/Guides/Getting-Started.md returns raw markdown today), readers and AI tools already have a clean path to consume page content. The page-level UI affordance the plugin adds isn't a strong enough net add to justify the dependency. Closing this myself rather than wasting reviewer time. Thanks for the great existing setup!

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