reconhub / learn

RECON learn: a free, open platform for training material on epidemics analysis
https://reconlearn.org
Other
35 stars 30 forks source link

Add solutions #70

Closed zkamvar closed 5 years ago

zkamvar commented 5 years ago

This will add the possibility for solutions to be created.

For example, the person writing a practical can have the parameter full_version: true in their practical YAML:

https://github.com/reconhub/learn/blob/684e1ae38c795ce423501cc56db04471f8b2761f/content/post/practical-real-time-response-1.Rmd#L14-L15

When render_new_rmds_to_md() or rerender() is run, the default option is to set this to FALSE, but if solution = TRUE, then the full_version parameter is flipped to TRUE and the practical is built and placed into the content/solutions directory and the links are all re-directed to ../post so that images and widgets aren't duplicated.

One caveat here:

If you want to go with this method, you must not use params as a variable. Knitr does not know how to parse the special params variable it created and one you created.

zkamvar commented 5 years ago

Because none of the practicals have changed even though I have removed and re-run them, I will consider this a success and merge the branch