Hi Christophe,
thanks for your response and for your work on distill! I indeed have a use case for a version of results = 'asis' that does not wrap the results into divs.
I would like to use panelsets in distill articles using xaringanExtra (https://github.com/gadenbuie/xaringanExtra#-panelset.) and programmatically create a number of panelsets (for multiple variables of a data frame), the panels filled with the results of multiple code chunks (plots, tables, etc.). Since panelsets work in distill only by using fenced divs, I'd insert these from within the code chunks using cat(), (e.g. cat("::::: {.panelset}", "\n")) and using chunk option results = 'asis' . Some code chunks to illustrate this:
The following code works fine in distill since the fenced divs and all the content for the tabs are integrated in one single code chunk, so there is no problem since all the output is wrapped in one surrounding <div class="layout-chunk" data-layout="l-body"> results from the code chunk </div>.
```{r results='asis'}
library(xaringanExtra)
xaringanExtra::use_panelset()
cat("::::: {.panelset}", "\n")
cat("::: {.panel}", "\n", "[First Tab]{.panel-name}", "\n")
plot(rnorm(50), main = "Plot 1")
cat(":::", "\n")
cat("::: {.panel}", "\n", "[Second Tab]{.panel-name}", "\n")
plot(rnorm(150), main = "Plot 2")
cat(":::", "\n")
cat(":::::", "\n")
If we split the same code into multiple code chunks the panelsets do not work anymore, I guess because the div that opens for starting the panelset does not wrap the entire output, s. the following chunks:
```{r results='asis'}
cat("::::: {.panelset}", "\n")
cat("::: {.panel}", "\n", "[First Tab]{.panel-name}", "\n")
```{r results='asis'}
plot(rnorm(50), main = "Plot 1")
cat(":::", "\n")
```{r results='asis'}
cat("::: {.panel}", "\n", "[Second Tab]{.panel-name}", "\n")
plot(rnorm(150), main = "Plot 2")
cat(":::", "\n")
cat(":::::", "\n")
Since I want to insert panelsets programmatically via loop (with plots and tabs for a varying number of variables from a df), I would need a results='asis' option for distill that really inserts the results as they are, without any wrapping. Hope I could make it a little clearer why this would be of help. I'll open a feature request on the Github repo.
Thanks a lot!