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.

Copy button for code block

See original GitHub issue

Can we get a copy for code block like the following?

Tensorflow has it and I just submitted PR for scikit-image and I would love to submit PR for scikit-learn using this sphinx-copybutton extension.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
thoocommented, Nov 4, 2018

@samwaterbury Go ahead but I think there are a few things needed to be addressed because this change will affect every example page.

  1. There is already a button for Hide the prompts .. but not all code block has it. So it might be a good idea to put the copy button at the corner and reorient Hide the prompts.
  2. You might also want to have both button in similar dimensions to be aesthetically pleasing 😃.

@qinhanmin2014 Any suggestion or it would be fine without these suggestions??? @samwaterbury You might also want to checkout tensorflow document pages.

0reactions
thoocommented, Nov 5, 2018

@jnothman I am thinking of using this sphinx extension: https://github.com/choldgraf/sphinx-copybutton . Current I am just trying to get a copybutton looks and feels similar to the current button >>>.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Sphinx-copybutton — Sphinx Copybutton
Sphinx-copybutton does one thing: add a little “copy” button to the right of your code blocks. That's it! It is a lightweight wrapper...
Read more >
Add Copy-to-Clipboard Button to Code Blocks with Vanilla JS
The "copy" button is placed within the code block rather than outside it. Instead of polyfilling the Clipboard API, my implementation falls back...
Read more >
How to add a copy button to markdown code blocks using ...
To create this copy button, we need to append a button to each code block and have that button copy the code into...
Read more >
Hugo - Dynamically Add Copy Code Snippet Button
Automatically add the copy button without having to add specific to a post · Works with both line numbers on and line numbers...
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