From 16a762f28fcbdb8b04566de2390b9a6046d91be5 Mon Sep 17 00:00:00 2001 From: john Date: Wed, 28 Oct 2020 17:08:15 +0100 Subject: [PATCH 1/3] updae to v0.8.0 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index dec304d..8fc3b06 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rtemps Type: Package Title: R Templates for Reproducible Data Analyses -Version: 0.7.0 +Version: 0.8.0 Authors@R: person("John", "Zobolas", role = c("aut", "cph", "cre"), email = "bblodfon@gmail.com", comment = c(ORCID = "0000-0002-3609-8674")) Description: A collection of R Markdown templates for nicely structured, reproducible From 31f23b710a01b07fc90961c8c0aca5c8aac40df4 Mon Sep 17 00:00:00 2001 From: john Date: Thu, 29 Oct 2020 12:55:56 +0100 Subject: [PATCH 2/3] bug fix --- inst/rstudio/templates/project/resources/hide_code.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inst/rstudio/templates/project/resources/hide_code.html b/inst/rstudio/templates/project/resources/hide_code.html index d2d9ae5..f3f5825 100644 --- a/inst/rstudio/templates/project/resources/hide_code.html +++ b/inst/rstudio/templates/project/resources/hide_code.html @@ -304,7 +304,7 @@ var classList = $(this).attr('class').split(/\s+/); for (var i = 0; i < classList.length; i++) { if (classList[i] === 'fold-show') { - show = 'hide' + show = true; } } @@ -335,6 +335,9 @@ div.before(buttonRow); + // hack: return show to false, otherwise all next codeBlocks will be shown! + show = false; + // update state of button on show/hide div.on('hidden.bs.collapse', function () { showCodeText.text('Code'); From b749c5d62c2e37e4d139ce566e425742f32433ec Mon Sep 17 00:00:00 2001 From: john Date: Thu, 29 Oct 2020 12:56:53 +0100 Subject: [PATCH 3/3] add example to show specific codeBlock even though all others are hidden --- inst/rstudio/templates/project/resources/index.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/rstudio/templates/project/resources/index.Rmd b/inst/rstudio/templates/project/resources/index.Rmd index ed903d6..19c729f 100644 --- a/inst/rstudio/templates/project/resources/index.Rmd +++ b/inst/rstudio/templates/project/resources/index.Rmd @@ -120,7 +120,7 @@ An orange box!!! Remember figure (\@ref(fig:example-plot))! # R session info {-} -```{r session info, comment=""} +```{r session info, comment="", class.source = 'fold-show'} xfun::session_info() ```