Use quarto just for code execution #12357
-
Hi there 👋, I'm hoping to integrate Quarto into my own project, which is aimed at producing more accessible STEM coursework. I'm wondering if it's possible to use Quarto solely for the code-execution aspect. EDIT: completely rewriting my question for clarity For example, if I have the following code: ```{r}
a <- c(1, 4, 2)
a
```
| Col1 | Col2 | Col3 |
|------|------|------|
| A | B | C |
| E | F | G |
| A | G | G |
: First Table {#tbl-first}
See @tbl-first for details. I am hoping for the following result: ``` r
a <- c(1, 4, 2)
a
```
[1] 1 4 2
| Col1 | Col2 | Col3 |
|------|------|------|
| A | B | C |
| E | F | G |
| A | G | G |
: First Table {#tbl-first}
See @tbl-first for details. Where the code block is executed, but the Markdown is left as is. My reason for this is my project has it's own LaTeX-to-Markdown and Markdown-to-accessible-HTML processors, and I'm hoping to use Quarto along with those, for those who need it. Sidenote: for bonus points, it would also love the ability to wrap the code output in some way, for example: ``` r
a <- c(1, 4, 2)
a
```
:::code-output
[1] 1 4 2
::: Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
This is (mostly) Pandoc behaviour for GFM format. You can use |
Beta Was this translation helpful? Give feedback.
-
For reference: |
Beta Was this translation helpful? Give feedback.
You could target the intermediate markdown
keep-md: true
but Quarto does not control what is emitted by code.So if a code emits HTML, you'll end up with HTML.
Beyond that, you have access to all Markdown variants and extensions from Pandoc.
Note that all code is transformed to Pandoc AST (the schematic representation of a document), so it has to be written back and this uses opinionated writers.
About your new "sidenote", write your own Lua filter to do that or use engine specific features:
But again, there is no garant…