jhelvy / renderthis

An R package for building xaringan slides into multiple outputs, including html, pdf, png, gif, pptx, and mp4.
https://jhelvy.github.io/renderthis
Other
172 stars 12 forks source link

Update xaringan_to_pdf(), package deps and path handling #2

Closed gadenbuie closed 3 years ago

gadenbuie commented 3 years ago

This is a bit of an entangled PR with a few relatively minor changes.

And finally, I replaced DescTools with functions from fs. DescTools is a fairly big package with a reasonable number of dependencies. fs specializes in working with paths across all systems and is commonly used in the tidyverse/rmarkdown ecosystem so it's very likely to already be installed.

I'm pretty certain I didn't break anything with the last change, but please give it a look to make sure I wasn't missing a critical detail.

gadenbuie commented 3 years ago

I just pushed two more commits. 1c8a2f7 (#2) refactors build_all() to simplify the nested if...else structure. Again, let me know if I missed a detail there.

I also added the cli package to report build progress:

> build_all("inst/example/slides.Rmd", c("html", "gif"))
✓ Building slides.html from slides.Rmd ... done
✓ Building slides.pdf from slides.html ... done
✓ Building slides.gif from slides.pdf ... done
jhelvy commented 3 years ago

Awesome, thanks for these quick fixes! Particularly appreciate the {fs} suggestion - I wasn't super happy with the DescTools dependency but didn't know of a better solution for handling the file path problems.