Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add copy-to-clipboard functionality to code blocks #159

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fiveop
Copy link

@fiveop fiveop commented Nov 25, 2024

An accompanying patch (carpentries/sandpaper#625) for sandpaper adds buttons with class copy-button to code blocks.

The styling of the button is a suggestion.

The overall intention is to resolve carpentries/workbench#58.

An accompanying patch for sandpaper adds buttons with class copy-button to code
blocks.
@froggleston
Copy link
Contributor

Hi @fiveop - thank you for the contribution! I have spoken to @tobyhodges about this and we have a couple of concerns:

  1. learners would feel motivated to use the copy paste functionality in live workshops when following along and typing is a key tenet of our pedagogy
  2. instructors may feel motivated to use copy paste in live settings, when they are running short on time for example

A compromise could be that this copy paste option is only enabled when a configuration setting is provided, e.g. a "debug" or development mode for that lesson. This would allow lesson developers and maintainers to turn this on locally and use the functionality to quickly debug issues and code blocks. This would also mean that our official lessons would have this option disabled and the lessons would look as they do now.

Would this be a fair solution?

@fiveop
Copy link
Author

fiveop commented Nov 26, 2024

I have not thought of that and I admit that it is very rare that I missed such a button, mostly while preparing for a course, or as you suggest, while working on the material. Regarding your arguments:

  1. I would agree with that to a certain degree. In my workshops participants usually do not have the learning material open, but there are of course people who use the material for self-study.
  2. I wold argue that we should trust Carpentries instructors not to do that.

Overall such a button offers a small convenience, replacing a selection and a shortcut with a single click. Given your arguments, I would suggest to leave the button out of the learners’ view, but show it in the instructors’ view. Though for me, that would be a compromise, as I tend towards trusting other people to act in their best interest after having instructed them how to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add copy-to-clipboard buttons to code blocks
2 participants