cmu-delphi / delphi-blog

The blog of the Delphi epidemiological forecasting group
https://delphi.cmu.edu/blog/
3 stars 1 forks source link

Support code folding in the blog #13

Closed capnrefsmmat closed 4 years ago

capnrefsmmat commented 4 years ago

If we include an R code chunk and don't suppress the inclusion of the code, it appears as an inline code chunk right in the text.

R Markdown normally supports code folding, where the chunk initially appears hidden and a little "Code" button makes it appear. But Blogdown doesn't support that unless we manually add some JS to the theme. A couple links:

https://stackoverflow.com/questions/45360998/code-folding-in-bookdown https://www.jepusto.com/code-folding-with-blogdown-academic/

Can we add something similar to the Hugo theme we're using, so we can include code chunks without disrupting the flow of the text?

adamperer commented 4 years ago

@sgratzl would it be possible for you to estimate how much work this would be?

sgratzl commented 4 years ago

around half an hour, see PR