Skip to content

UX: Ensure all code blocks have copy buttons for consistency #55275

@debjotyms

Description

@debjotyms

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions