question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make code blocks copyable in default theme

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
dovycommented, Mar 27, 2019

Fixed. I missed the -plugin due to text breaking.

https://github.com/dovy/vuepress-plugin-clipboard-copy/ ['@dovyp/vuepress-plugin-clipboard-copy', true]

😃

3reactions
shershen08commented, Aug 19, 2018

I’ve created a implementation, that behaves like this: https://www.youtube.com/watch?v=YJ3lnB9AxcM&feature=youtu.be Will create a PR soon

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set the default appearance of code blocks f...
To set the default appearance of code blocks in your site: Choose the cog icon, then choose General Configuration under Confluence ...
Read more >
1 Code::Blocks Project Management
During the first startup, Code::Blocks will copy the presettings from 'Default User' to the application data of the current users. To create a...
Read more >
Reset Codeblock Color Themes to Default - YouTube
this video is for people who want to reset codeblocks color themes to default.
Read more >
Add a 'copy code to clipboard' button to your blog's code blocks
In this tutorial, I will show you how to add a 'copy code' button to code blocks in your blog that will copy...
Read more >
How to add a copy button in the code blocks for RST/Read the ...
In Sphinx projects, the presentation of the HTML page is controlled using a template language (Jinja2 by default). So you can make your ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found