R Markdown now has the option to automatically show or hide code chunks in your .Rmd document. However, this seems to only work with R code chunks.
---
output:
html_document:
code_folding: hide
---
```{r}
print("This code chunk will be hidden")
```
```{r, engine='bash'}
echo "This code chunk will not be hidden"
```{r, engine='python'}
print "Will this code chunk be hidden?"
```
```{r}
system('uname -srv',intern=T)
sessionInfo()
```
The only solution I have been able to come up with is to hide the code behind a blank tab
---
output:
html_document:
code_folding: hide
---
```{r}
print("This code chunk will be hidden")
```
# Source code {.tabset .tabset-pills}
## Hide Code
## Show Code
```{r, engine='bash'}
echo "This code chunk will not be hidden"
```
```{r, engine='python'}
print "Will this code chunk be hidden?"
```
```{r}
system('uname -srv',intern=T)
sessionInfo()
```
Is there a better solution to this which will enable code folding for all code chunks?