kubernetes / kubernetes/website

UX: Ensure all code blocks have copy buttons for consistency

Open
#55,275 5 comments 0 reactions 0 assignees View on GitHub
area/web-development kind/feature lifecycle/stale needs-triage
Dominant language
HTML
Stars
5.4k
Forks
15.7k
Avg merge
4d 18h
Merged PRs (30d)
204

Description

**This is a Feature Request**

**What would you like to be added**
I would like to see a "Copy" button added to all standard Markdown code blocks across the Kubernetes documentation.

**Why is this needed**
While studying for the CKA exam, I found myself reading through the documentation a lot. I noticed that while some code blocks have a convenient copy button (because they use the custom `code` shortcodes), many standard Markdown code blocks throughout the docs do not. It can be a bit tedious to manually highlight and copy code from these blocks. Ensuring all code blocks have a copy button would make the reading and learning experience much smoother and more consistent for everyone!

**Comments**
I initially jumped the gun and opened a PR for this (#55268) where I tried solving this by including a small universal JavaScript snippet to automatically add the buttons. However, a contributor correctly pointed out that creating a new custom script adds extra maintenance overhead, and suggested a better approach might be to systematically replace the standard code blocks with the existing shortcodes.

I am very interested in helping solve this issue! I'm opening this feature request first to properly discuss the best path forward. If the maintainers agree that updating the markdown files to use the built-in shortcode is the right way to go, I would love to take on that work.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing `code` shortcodes in the Kubernetes documentation and the approach discussed in PR #55268. Identify how standard Markdown code blocks are distributed across the documentation and determine the scope of replacing them with the built-in shortcode. Done means the affected code blocks consistently render with copy buttons without adding a new universal script.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.