learnr icon indicating copy to clipboard operation
learnr copied to clipboard

Make tutorials printable

Open siebrenf opened this issue 4 years ago • 3 comments

see FR

PR task list:

  • [x] Update NEWS
  • [ ] Add tests (if possible)
  • [ ] Update documentation with devtools::document()

siebrenf avatar Jan 08 '21 18:01 siebrenf

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jan 08 '21 18:01 CLAassistant

Thank you for packaging this in a pull request, but I don't think we'd want to add a print button to every learnr tutorial and I don't think we'd want to add an argument to learnr::tutorial() to cover this feature.

Another possible solution would be to add a function — tutorial_print_button() or tutorialPrintButton()? — that would wrap the CSS and JavaScript in this PR that could be called by a user to add a print button, either to the tutorial footer or directly wherever the function is called.

That approach would also solve the problem of not wanting to add the print CSS to tutorials where authors don't want users to print the tutorial to "see ahead".

gadenbuie avatar Jan 08 '21 18:01 gadenbuie

I thought I'd pack it up since you've already wrote the whole solution, but I understand this implementation might not be desired. Unfortunately, I have no idea how to implement your suggestion (3 languages in 1 function, adding elements to the footer and CSS). Feel free to close this PR if it's easier to start from scratch/too much of a hassle!

siebrenf avatar Jan 11 '21 13:01 siebrenf