Add docusaurus-plugin-copy-page-button#4682
Conversation
|
Thank you for raising your pull request and contributing to our Community |
|
Thanks for sharing this! Is there a way to customize the button text, so we can use localized labels for different language sites? |
|
Great question @nfs0619 — just shipped v0.7.0 and bumped this PR's version constraint so you can do exactly that. The plugin now accepts a // sites/zh-CN/docusaurus.config.js
plugins: [
// ...
[
'docusaurus-plugin-copy-page-button',
{
labels: {
button: { label: '复制页面' },
copy: { title: '复制页面', description: '将本页内容复制为 Markdown' },
view: { title: '以 Markdown 查看' },
chatgpt: { title: '在 ChatGPT 中打开' },
claude: { title: '在 Claude 中打开' },
perplexity: { title: '在 Perplexity 中打开' },
gemini: { title: '在 Gemini 中打开' },
},
},
],
],You only need to override the strings you want translated — anything missing falls back to the English default. Same shape for I left the configs in this PR with no |
|
Thanks for the quick update, and thanks for contributing this plugin. The new I’ll take care of the localized config on our side before merging. |
Summary
Adds
docusaurus-plugin-copy-page-buttonacross all five language sites so readers can copy any wiki page as clean markdown — useful when piping hardware setup or firmware troubleshooting context 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:
Live preview of the UI: https://portdeveloper.github.io/copy-page-button-showcase/
Adoption
The plugin currently ships on the 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
'docusaurus-plugin-copy-page-button'to thepluginsarray in each language config (sites/en,sites/zh-CN,sites/ja,sites/es,sites/pt-BR)docusaurus-plugin-copy-page-button@^0.6.2to rootdependenciesyarn.lockupdatesyarn buildof the English site passes locally; the other four configs use the identical plugin entry.