You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> askYesNo("Is this a good example?")
Isthisagoodexample? (Yes/no/cancel) Yes
[1] TRUE
It would be good if the copy-to-clipboard function only copied askYesNo("Is this a good example?").
Code to implement this is linked in the above issue, but you will need to work out how to integrate this with our current process for building the docs from source. The docs are built with mkdocs using Python, as described in the Contributing to docs section.
The text was updated successfully, but these errors were encountered:
Firstly, this is not R, and should not be fenced with ```R. It should be fenced with ```Rconsole and the indentation should be removed.
Sadly, this does not fix the actual issue here.
I do not like the Issue 106 fix. The idea is to add this wodge of code to every page, which installs an onload handler for the page. It will scan the page and do the following things:
Find code within code blocks that begins with # and mark it with the CSS user-select: none.
Find code that begins with $ and mark the $ with user-select: none.
Find code that begins with << and mark it with user-select: none.
Find code that begins with << and delete the <<.
Gather all the code that is still user-selectable and add a data-clipboard-text attribute with this text to the box.
I would argue that this isn't what we want.
What we really want is essentially just number 5 (we are using clipboard.js and this data-clipboard-text attribute is how to make the text whatever we want). I don't think that making a mouse drag fail to select the prompt or the output is right -- if people want to copy that why not let them? The copy text button is the thing. But ideally this shouldn't be done by post-processing every page onload. But how to do it? Not with a new Pygments lexer, not with a renderer, maybe a filter?
Sadly, I have not managed to find out where best to do this.
This is issue 106 on the R Dev Container repo.
An example of where it would be helpful to restrict input is in the Example Contribution Workflow:
It would be good if the copy-to-clipboard function only copied
askYesNo("Is this a good example?")
.Code to implement this is linked in the above issue, but you will need to work out how to integrate this with our current process for building the docs from source. The docs are built with mkdocs using Python, as described in the Contributing to docs section.
The text was updated successfully, but these errors were encountered: