Skip to content

Add copy to clipboard button to code blocks within documentation - #192

Merged
k-wall merged 2 commits into
kroxylicious:mainfrom
k-wall:copy-button
Aug 25, 2025
Merged

Add copy to clipboard button to code blocks within documentation#192
k-wall merged 2 commits into
kroxylicious:mainfrom
k-wall:copy-button

Conversation

@k-wall

@k-wall k-wall commented Aug 20, 2025

Copy link
Copy Markdown
Member

Our documentation sometimes contains code and config blocks. This is a especially true in the quickstarts where we present a list of instructions that the user is expected to follow. We want to make it easy for the users to copy the content from the documentation and paste it in their terminal or IDE.

This change add this function to the documentation on the website.

Approach based on a this SO article:

https://stackoverflow.com/questions/48078199/jekyll-code-snippet-copy-to-clipboard-button

Screenshot 2025-08-21 at 12 48 45

@k-wall
k-wall requested a review from a team as a code owner August 20, 2025 17:26
Comment thread _layouts/guide.html Outdated
Comment thread _layouts/guide.html Outdated
Comment thread _layouts/guide.html Outdated
Comment thread _layouts/guide.html Outdated
@k-wall k-wall changed the title Experiment - add copy to clipboard button to code blocks Add copy to clipboard button to code blocks Aug 21, 2025
@k-wall k-wall changed the title Add copy to clipboard button to code blocks Add copy to clipboard button to code blocks within documentation Aug 21, 2025
@k-wall k-wall self-assigned this Aug 21, 2025

@robobario robobario left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM with nits

Comment thread _sass/kroxylicious.scss Outdated
Comment thread _includes/asciidoctor-scripts/clipboard.html Outdated
Comment thread _includes/asciidoctor-scripts/clipboard.html Outdated
k-wall added 2 commits August 25, 2025 10:43
…ion.

the particular use-case I have in mind is quickstarts, but this also has general utility across the documentation.

Signed-off-by: Keith Wall <kwall@apache.org>
@k-wall
k-wall enabled auto-merge (rebase) August 25, 2025 09:43
@k-wall
k-wall merged commit 27a059b into kroxylicious:main Aug 25, 2025
2 checks passed
@k-wall
k-wall deleted the copy-button branch August 25, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants