jimhester / knitrBootstrap

A framework to create bootstrap styled HTML reports from knitr Rmarkdown.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to hide code or output.

Black-Milk opened this issue · comments

I'm unable to specify the option to Hide Code or Output via the YAML Front-Matter as such:


---
output:
  knitrBootstrap::bootstrap_document:
    title: "Test file"
    theme: amelia
    highlight: sunburst
    theme.chooser: TRUE
    highlight.chooser: TRUE
    show.code: FALSE
    show.output: FALSE

---

Whereas before, with the CRAN release of knitrbootstrap, I was able to specify the following in my .Rprofile and it would work:

options(rstudio.markdownToHTML =
function(inputFile, outputFile) {
library(knitrBootstrap)
knit_bootstrap_md(input=inputFile, output=outputFile, chooser=c("boot", "code"), show_code=FALSE, show_output=FALSE)
}
)

where show_code=FALSE and show_output=FALSE are specified. How do I address this issue?

Nevermind, I had a difficult time understanding how chunk options should be specified. To set this option globally for all chunks, you need to create a knitr chunk and type the following:

```{r Global Chunk Setup, include=FALSE}
knitr::opts_chunk$set(comment = NA, bootstrap.show.code = FALSE, bootstrap.show.output = FALSE)

```

You don't have to include comment = NA.