Skip to content

feat(*): add copy button for code blocks#233

Open
ChronosSF wants to merge 5 commits into
masterfrom
sstoychev/add-copy-code-block
Open

feat(*): add copy button for code blocks#233
ChronosSF wants to merge 5 commits into
masterfrom
sstoychev/add-copy-code-block

Conversation

@ChronosSF
Copy link
Copy Markdown
Member

Closes #231

@ChronosSF ChronosSF requested a review from Copilot May 26, 2026 12:33
@ChronosSF ChronosSF added the ❌ status: awaiting-test PRs awaiting manual verification label May 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a client-side “copy to clipboard” control to rendered documentation code blocks, addressing Issue #231 by enhancing the docs UX for code snippets.

Changes:

  • Introduces a new client script that injects a copy button into each pre.astro-code block and re-initializes on astro:page-load (view transitions).
  • Wires the script into the global head so it runs across documentation pages.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/scripts/copy-code.ts Implements DOM injection, hover/focus behavior, and clipboard copy logic for code blocks.
src/components/overrides/Head.astro Loads the copy-button script site-wide via a <script src=...> tag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/scripts/copy-code.ts Outdated
Comment thread src/scripts/copy-code.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a copy button for code snippets.

2 participants