Hi,
I'd like to insert results of code chunks in a distill_article 'asis', i.e. just the raw markdown code without any formatting or wrapping (s. Rmarkdown cookbook
). What works fine with rmarkdown::html_document I cannot achieve with distill::distill_articlewhere the results of code chunks seem to be always wrapped in <div> even using chunk option results='asis'.
I try to show this in the following reprex - I use
- R v4.1.1
- RStudio v1.4.1717,
- distill v1.2
- rmarkdown v2.10
The following Rmd file contains one chunk using results='asis' and can be rendered as html_document or distill_article.
---
title: "Test chunk option `results='asis'`"
output:
rmarkdown::html_document:
keep_md: TRUE
distill::distill_article:
keep_md: TRUE
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r results='asis'}
cat("Test")
```
1) rmarkdown::html_document
The output from rmarkdown::html_document is as expected where the result is rendered correctly as just Test in the resulting (intermediate) markdown File (I leave out the YAML here):
Test
2) distill::distill_article
Using output distill::distill_article the option results='asis' does lead to a raw markdown output: In the rendered md-File the result of the code chunk is still wrapped in a <div>., s. the markdown file.
<div class="layout-chunk" data-layout="l-body">
Test
</div>
```{.r .distill-force-highlighting-css}
```
Is there a way to achieve raw markdown output from code chunks in distill, not wrapped in a <div>?
Thanks for your time!
Best, G