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

Add the ability to hide scribble on certain slides #166

Closed mattwarkentin closed 2 years ago

mattwarkentin commented 2 years ago

Fixes #158

This small PR allows users to add the 'hide-scribble' class to any slide (including the title slide) to disable scribble entirely. With the 'hide-scribble' class, the toolbox is hidden and cannot be toggled back to visible, and any drawing is disabled. In other words, the toolbox is hidden and pressing 'S' does nothing.

mattwarkentin commented 2 years ago

I think the current PR addresses the original request:

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

But I'm not sure it satisfies your recent comment:

...we'd want to ensure the controls still appear when summoned via the keyboard shortcuts

I have made it so the addition of the 'hide-scribble' class disables scribble entirely for the specific slide and has no affect on other (normal) slides. But your comment sounds like you want the controls hidden, but that they could be recovered by the keyboard shortcut.

I will wait to hear your thoughts and we can iterate as needed.

mattwarkentin commented 2 years ago

I'm pretty neutral on the class name - maybe a slight preference for no-scribble because of its brevity. If you agree, I can make this change quickly.

gadenbuie commented 2 years ago

I like no-scribble, let's go with that one!

mattwarkentin commented 2 years ago

Done! I also made an attempt at documenting the usage in the showcasing slide deck, because, well, if it's not documented it doesn't exist. I think that is how the saying goes.

gadenbuie commented 2 years ago

Thanks Matt! I'm going to wait a little bit to merge this once #163 lands (i.e. once the current version makes it onto CRAN 🤞)

codecov-commenter commented 2 years ago

Codecov Report

Merging #166 (9724967) into main (a5343ad) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #166   +/-   ##
=======================================
  Coverage   51.40%   51.40%           
=======================================
  Files          20       20           
  Lines         782      782           
=======================================
  Hits          402      402           
  Misses        380      380           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a5343ad...9724967. Read the comment docs.