Usethis: use_tutorial() creates file in wrong location and ignores html built files, but run_tutorial() requires it

Created on 17 Jun 2019  ·  7Comments  ·  Source: r-lib/usethis

use_tutorial() creates R Markdown files in inst/tutorials/ as single files. But learnr requires them in individual folders:

Create a tutorials directory within the inst sub-directory of your package and then create a directory for your tutorial there (e.g. inst/tutorials/hello, inst/tutorials/slidy, etc.). https://rstudio.github.io/learnr/publishing.html

Likewise, use_tutorial() adds git ignore to the generated html tutorials, but learnr requires the html files to be present:

Render your tutorial .Rmd to .html and include the rendered HTML in your R package (this will happen automatically during development & preview of the tutorial, you just need to be sure to include the .html file within the R package when you build it). https://rstudio.github.io/learnr/publishing.html

So when you run run_tutorials() for the tutorial, you get:

> learnr::run_tutorial("chapter1", package = "acdcourse")
Error in shiny_prerendered_html(input_rmd, encoding, render_args) : 
  Prerendered HTML file not found at ./chapter1.html

Not sure if there is a disconnect between usethis and learnr or if learnr intends to go the route as indicated by use_tutorial().

bug tidy-dev-day

Most helpful comment

We are at tidyverse developer day and tackling this issue! With @angela-li @isteves!

All 7 comments

Hello folks with the use_tutorial() PR (#645) from tidyverse dev day!

@angela-li @xvrdm @jules32 @jessesadler

I'd appreciate your thoughts on this problem.

Maybe people at the second tidyverse dev day can pick up this baton and push things forward.

Yes, I believe the original team on this project (@jules32 @xvrdm and me) will all be at Tidyverse Dev Day no. 2, so we can plan to tackle this then!

Yes -- I haven't had a chance to think about it ahead of time but I'd love
to continue together on Monday!

On Tue, Jul 2, 2019, 18:22 Angela Li notifications@github.com wrote:

Yes, I believe the original team on this project (@jules32
https://github.com/jules32 @xvrdm https://github.com/xvrdm and me)
will all be at Tidyverse Dev Day #2
https://github.com/r-lib/usethis/issues/2, so we can plan to tackle
this then!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/r-lib/usethis/issues/782?email_source=notifications&email_token=ABM6OROPK4TPPBCYAFZ2AGTP5P5MRA5CNFSM4HYU7D22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZC7KTQ#issuecomment-507901262,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABM6ORISUIPCNUD72G663CDP5P5MRANCNFSM4HYU7D2Q
.

Hi all!
Unfortunately I did not register in time for the conf (we realized too late that my “ticket” was only a prebooking) so I had to cancel the entire trip, including tidyverse dev day.
😭😭

Gutted I won’t be here, but I am sure you will teach this issue a lesson 🕵️‍♀️!

We are at tidyverse developer day and tackling this issue! With @angela-li @isteves!

Hi @lwjohnst86! Thanks so much for reporting this. The development version of learnr no longer requires html files to be in the tutorial folder (this is a better practice, generally), so we will not implement the following in this bugfix:

Render your tutorial .Rmd to .html and include the rendered HTML in your R package (this will happen automatically during development & preview of the tutorial, you just need to be sure to include the .html file within the R package when you build it). https://rstudio.github.io/learnr/publishing.html

You can install the dev version with remotes::install_github("rstudio/learnr") - make sure to install updated versions of dependencies too, especially rmarkdown. You can also see rstudio/learnr#169 for more info.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EmilHvitfeldt picture EmilHvitfeldt  ·  3Comments

malcolmbarrett picture malcolmbarrett  ·  4Comments

atheobold picture atheobold  ·  7Comments

aosmith16 picture aosmith16  ·  5Comments

jennybc picture jennybc  ·  4Comments