gadenbuie / xaringanExtra

:ferris_wheel: A playground of enhancements and extensions for xaringan slides.
https://pkg.garrickadenbuie.com/xaringanExtra
Other
445 stars 36 forks source link

Feature request: To disable scribble on a specific slide #158

Closed koliajaykr closed 2 years ago

koliajaykr commented 2 years ago

Scribble is a fantastic feature. But it will be nice if we can disable the scribble feature on a few selective slides like the title slide.

Thank you

mattwarkentin commented 2 years ago

@gadenbuie I think this would be relatively straightforward and primarily require some changes to the function below to check for a class and skip instantiating a canvas if the class is present (rather than adding a canvas to all slides, by default). Let me know if you want me to attempt the feature request. https://github.com/gadenbuie/xaringanExtra/blob/ae6a5ad369a655682c4a57aece88b4660d9fe62d/inst/scribble/scribble.js#L150-L173

gadenbuie commented 2 years ago

I think maybe the request is coming from the opposite angle, which would be to hide the controls on specific slides. That's a different problem since the controls aren't a child of the element with the slide class and we'd want to ensure the controls still appear when summoned via the keyboard shortcuts.

gadenbuie commented 2 years ago

oh and @mattwarkentin of course a PR would be much appreciated if you want to! 😄

mattwarkentin commented 2 years ago

@gadenbuie You're totally right. I misunderstood the original request. Sending PR imminently...