Skip to content

[documentation][a11y] Add "copy code to clipboard" button for copying code snippets #9531

@hydrosquall

Description

@hydrosquall

Enhancement Description

We could add a button could add a button so that copying JSON snippets from the docs is easier, especially for folks navigating docs without easy ability to click-and-drag (e.g. coding with voice, with trackpad instead of mouse)

Inspired by Salma's post, which also contains a reference JS implementation: https://whitep4nth3r.com/blog/how-to-build-a-copy-code-snippet-button/

Image

If it worked out in vega-lite, we could propose a similar change in Vega too.

Potential scope

This could be applied to just examples where the JSON is stands on its own

Image

Or to blocks where the code snippet is partial

Image

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions