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
173 stars 12 forks source link

`assert_chrome_installed()` could give better advice #36

Open gadenbuie opened 3 years ago

gadenbuie commented 3 years ago

As pointed out by @yyzeng in this comment

The underlied chromote::find_chrome() just CAN'T find chrome.exe's path in my computer, but I have checked and found the path is in the Register with key "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\chrome.exe\\", 😭 So, I have to set Sys.setenv("CHROMOTE_CHROME" = "C:\\Users\\admin\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe") before using xaringanBuilder::build_pdf("Test.Rmd"), then everything is ok.)

we could add some advice about setting the CHROMOTE_CHROME env variable if Chrome is installed but not found by chromote::find_chrome(). I guess this is something that should be handled by chromote::find_chrome(), but we use our own error message since the underlying error isn't very user friendly.

Our current error message reads

Error: This function requires a local installation of the Chrome browser. 
  You can also use other browsers based on Chromium, such as Chromium itself, 
  Edge, Vivaldi, Brave, or Opera.
gadenbuie commented 2 years ago

e.g. #39