Skip to content

Make code blocks copyable in default theme #703

@rdwatters

Description

@rdwatters

Feature request

What problem does this feature solve?

This is interesting phrasing, since many features don't solve a problem as much as provide an enhancement 😉 . That said, execCommand is a common feature of code blocks in technical documentation. If you're writing large amounts of code, it's often easier to have the user click a copy button (icon or text or whatever) and have a confirmation of some kind saying the text has been copied to the clipboard.

What does the proposed API look like?

Go here and hover the first code block: https://angular.io/guide/displaying-data

How should this be implemented in your opinion?

Plenty of options for implementation, including the popular clipboard.js. I think turning this feature on/off should be as simple as a boolean in the config.

Are you willing to work on this yourself?**

I wish I could, but I'm more of a technical writer than a frontend developer, so this feels a bit brazen.

Cheers all around to VuePress (just discovered this project a couple days ago and it's AWESOME!) and to the Vue community in general. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: feature requestRequest to add a new featureversion: nextPlanned to do or already included in the next(1.0.0) version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions