
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
@crypblizz/docusaurus-plugin-copy-page-button
Advanced tools
Docusaurus plugin that adds a copy page button to extract documentation content as markdown for AI tools like ChatGPT and Claude
Extract Docusaurus documentation content as markdown for AI tools like ChatGPT and Claude
A lightweight Docusaurus plugin that automatically adds a "Copy page" button to your documentation site's sidebar. Perfect for developers who want to quickly extract documentation content for AI assistance, code reviews, or content analysis.
npm install docusaurus-plugin-copy-page-button
Add the plugin to your docusaurus.config.js:
module.exports = {
plugins: ["docusaurus-plugin-copy-page-button"],
};
The button will automatically appear in your table of contents sidebar!
Use custom styles to position the button differently:
module.exports = {
plugins: [
[
"docusaurus-plugin-copy-page-button",
{
customStyles: {
button: {
style: {
position: "fixed",
top: "20px",
right: "20px",
},
},
},
},
],
],
};
You can customize the appearance of the copy page button by passing a customStyles option:
module.exports = {
plugins: [
[
"docusaurus-plugin-copy-page-button",
{
customStyles: {
button: {
className: "my-custom-button",
style: {
backgroundColor: "#4CAF50",
color: "white",
borderRadius: "8px",
},
},
dropdown: {
className: "my-custom-dropdown",
style: {
backgroundColor: "#f8f9fa",
border: "2px solid #4CAF50",
},
},
dropdownItem: {
style: {
padding: "12px 20px",
fontSize: "16px",
},
},
container: {
className: "my-button-container",
},
},
},
],
],
};
button - The main copy page button (positioning styles like position, top, left are automatically applied to the container)dropdown - The dropdown menu that appears when clicking the buttondropdownItem - Individual items in the dropdown menucontainer - The wrapper container around the buttonEach target accepts:
className - CSS class name(s) to add to the elementstyle - Inline styles object (React style format)Custom styles are merged with the default styles, so you only need to specify what you want to change.
module.exports = {
plugins: [
[
"docusaurus-plugin-copy-page-button",
{
customStyles: {
button: {
style: {
position: "fixed",
top: "100px",
left: "100px",
zIndex: 1000,
},
},
},
},
],
],
};
Note: Positioning styles (position, top, right, bottom, left, zIndex, transform) specified in the button configuration are automatically applied to the container element for proper positioning control.
module.exports = {
plugins: [
[
"docusaurus-plugin-copy-page-button",
{
customStyles: {
button: {
style: {
backgroundColor: "transparent",
border: "2px solid #007acc",
color: "#007acc",
borderRadius: "12px",
fontWeight: "bold",
},
},
},
},
],
],
};
You can add your own actions to the dropdown using customItems.
Supported action types:
copyMarkdown – copy extracted markdown to clipboardviewMarkdown – open extracted markdown in a new tabopenUrl – open a URL built from a template; supports placeholders {url} and {title}copyText – copy arbitrary text, or use a template via textTemplate with {url} and {title}Example configuration with a “Copy MCP server” item that copies a URL to clipboard:
module.exports = {
plugins: [
[
"docusaurus-plugin-copy-page-button",
{
customItems: [
{
id: "copy-mcp-server",
title: "Copy MCP server",
description: "Copy server URL to clipboard",
emoji: "🔌",
action: { type: "copyText", text: "https://www.wikipedia.org/" },
},
],
},
],
],
};
You may also use a raw SVG string instead of emoji by providing svg: "<svg ...>...</svg>".
To test this plugin locally during development:
git clone https://github.com/portdeveloper/docusaurus-plugin-copy-page-button.git
cd docusaurus-plugin-copy-page-button
npm install
npm link
Navigate to your Docusaurus project and link the local plugin:
cd /path/to/your/docusaurus/project
npm link docusaurus-plugin-copy-page-button
Add the plugin to your config:
module.exports = {
plugins: ["docusaurus-plugin-copy-page-button"],
};
npm start
The locally linked plugin will now be active in your Docusaurus site. Any changes you make to the plugin source will require restarting the Docusaurus development server.
The plugin intelligently extracts page content by:
Docusaurus plugin, copy page button, extract documentation, markdown conversion, AI tools integration, ChatGPT documentation, Claude AI, content extraction, developer tools, documentation productivity, React plugin, JavaScript documentation tools.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
MIT © portdeveloper
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.