docs: add docusaurus-plugin-copy-page-button#1736
Conversation
✅ Deploy Preview for oasisprotocol-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
matevz
left a comment
There was a problem hiding this comment.
-
This seems like duplicated functionality of llms.txt implemented in #1626 and #1673. For every documentation page you can already get its markdown source by simply appending .md at the end of the url. It would be better if we didn't rely on external npm package for this and just wrap the existing markdown code in form of a Copy page button.
-
There is a bug when clicking on a link that includes an anchor, for example https://deploy-preview-1736--oasisprotocol-docs.netlify.app/build/rofl/quickstart#prerequisites
, then the button is not visible. -
The button does not appear in no-javascript environment (not critical, but would be nice to have at least a link to markdown source).
|
Thanks for the review. Given the existing per-page Markdown support and the preference to avoid an external package for this UI, I’ll close this PR rather than push the package approach further. The anchor-link/no-JS notes are useful feedback; I’ll keep them in mind for the plugin and for any future custom implementation. |
Summary
docusaurus-plugin-copy-page-buttonto the docs dependenciesdocusaurus.config.tsWhy
Oasis docs include protocol, SDK, and developer reference pages that are useful to bring into AI tools. This adds a page-level copy/open button that exports the current page as clean markdown and includes one-click Open in ChatGPT, Claude, and Gemini actions.
I checked the repo for overlapping features before opening this. Oasis already has
llms.txt,llms-full.txt, and Context7 MCP documentation for corpus-level AI ingestion. This PR is different: it adds a page-level UI action for copying or opening the current page directly from the docs page.The plugin has no runtime dependencies and uses peer dependencies for Docusaurus and React.
Validation
git diff --checkNot run locally: full docs build, due the dependency install/build footprint in this environment.