From 0668585fba08c69c071fed6f05dc4147390ea86d Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Mar 2026 17:32:56 +0000 Subject: [PATCH 1/2] Rename Copy button label to "Copy for AI" for clarity https://claude.ai/code/session_01X5CeNeTR2tHHTMA8UmpR4f --- assets/copybutton.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/copybutton.js b/assets/copybutton.js index eedeeb9..3e3355d 100644 --- a/assets/copybutton.js +++ b/assets/copybutton.js @@ -50,17 +50,17 @@ var group = document.createElement("div"); group.className = "copybutton-group"; - // --- Copy as Markdown button --- + // --- Copy for AI button --- var copyBtn = document.createElement("button"); copyBtn.className = "button"; - copyBtn.title = "Copy page as Markdown"; - copyBtn.setAttribute("aria-label", "Copy page as Markdown"); + copyBtn.title = "Copy page as Markdown for AI"; + copyBtn.setAttribute("aria-label", "Copy page as Markdown for AI"); copyBtn.innerHTML = '' + '' + '' + '' + - 'Copy'; + 'Copy for AI'; copyBtn.addEventListener("click", function () { fetchAndCopy(mdUrl, function (err) { From 558e4c40d6a640b7e77b659d179bf930dfab28ee Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Mar 2026 17:34:22 +0000 Subject: [PATCH 2/2] Add configurable copy_label keyword to CopyButton Defaults to "Copy for AI". Pass via CopyButton(copy_label="..."). https://claude.ai/code/session_01X5CeNeTR2tHHTMA8UmpR4f --- assets/copybutton.js | 3 ++- src/pipeline.jl | 2 +- src/plugin.jl | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/assets/copybutton.js b/assets/copybutton.js index 3e3355d..10626b6 100644 --- a/assets/copybutton.js +++ b/assets/copybutton.js @@ -16,6 +16,7 @@ var mdUrl = config.mdUrl || ""; var providers = config.providers || []; var prompt = config.prompt || ""; + var copyLabel = config.copyLabel || "Copy for AI"; var canonicalBase = config.canonicalBase || ""; var pagePath = config.pagePath || ""; @@ -60,7 +61,7 @@ '' + '' + '' + - 'Copy for AI'; + '' + copyLabel + ''; copyBtn.addEventListener("click", function () { fetchAndCopy(mdUrl, function (err) { diff --git a/src/pipeline.jl b/src/pipeline.jl index bcd07e3..bca35d8 100644 --- a/src/pipeline.jl +++ b/src/pipeline.jl @@ -108,7 +108,7 @@ function _inject_html!(html_path, plugin, md_filename, md_content, rel_prefix, c injection = """ diff --git a/src/plugin.jl b/src/plugin.jl index 9dcb20b..432e022 100644 --- a/src/plugin.jl +++ b/src/plugin.jl @@ -35,7 +35,7 @@ const DEFAULT_PROVIDERS = Provider[ ] """ - CopyButton(; providers=nothing, prompt="Read") + CopyButton(; providers=nothing, prompt="Read", copy_label="Copy for AI") A [`Documenter.Plugin`] that adds floating "Copy as Markdown" and "Open in AI" buttons to opted-in documentation pages. @@ -52,6 +52,7 @@ Pages opt in by including a [`@copybutton`](@ref CopyButtonBlocks) block in thei Set to an empty list to disable the "Open in AI" button. - `prompt`: A prefix string prepended to the URL when opening in an AI provider. Defaults to `"Read"`. +- `copy_label`: Label text for the copy button. Defaults to `"Copy for AI"`. # Example @@ -76,10 +77,12 @@ CopyButton(providers = [ struct CopyButton <: Plugin providers::Vector{Provider} prompt::String + copy_label::String function CopyButton(; providers=nothing, prompt="Read", + copy_label="Copy for AI", ) provs = if providers === nothing copy(DEFAULT_PROVIDERS) @@ -91,6 +94,6 @@ struct CopyButton <: Plugin for p in providers ] end - new(provs, prompt) + new(provs, prompt, copy_label) end end