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

docs: Restrict copy-paste to input code #204

Closed
wants to merge 2 commits into from

Conversation

savsch
Copy link

@savsch savsch commented Mar 20, 2025

Resolves #106

This PR attempts to follow the method mentioned in the linked issue to support restricting copy-pasting of content inside code blocks (i.e. inside ```) to just input code in the following manner:

  • Lines starting with the prefix $ are considered to be "input lines". They can be copied.
  • Lines starting with the prefix << ("output lines") or # ("comment lines") are neither copied using the copy button, nor can they be selected by the user.

Also, the prefixes ($ , << , # ) themselves cannot be copied or selected.

Screenshots

This is what one of the changes looks like:

Before After
image image

Behaviour of the copy-to-clipboard button:

docs_restrict_copying_to_input_code.mp4

@iaine
Copy link
Collaborator

iaine commented Mar 20, 2025

Hi savsch,

Thanks for your PR.

If this is for the GSoC tests, could you please add a screenshot for the Hard1 test and a link to this PR on the wiki page:
https://github.com/rstats-gsoc/gsoc2025/wiki/Refining-the-R-Dev-Container

@hturner
Copy link
Member

hturner commented Mar 27, 2025

Thanks for the PR. Unfortunately, we had someone investigate this approach earlier and although the conclusion was not to pursue it we had not updated #106 (there was a link to the related discussion, r-devel/r-dev-day#60, but we had not posted a conclusion). I've now done this and closed both issues, so will also close this PR. For the purposes of GSoC though, this is still a valid submission for the Hard Test 1.

@hturner hturner closed this Mar 27, 2025
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.

3 participants