Replies: 3 comments 1 reply
-
(@CelieDs FYI, I've converted this into a Q&A discussion on https://github.com/quarto-dev/quarto-cli) |
Beta Was this translation helpful? Give feedback.
0 replies
-
The header needs to be top-level for tabset to detect it. The best you can do either as plain markdown or using computation: echo 'Here are the results from "result1".' > _results1.qmd
echo 'Here are the results from "result2".' > _results2.qmd ---
title: "Quarto Playground"
format: html
params:
results1: true
results2: false
---
## Markdown
::: {.panel-tabset}
## General Results
Here are the general results.
## Results
:::: {.content-hidden unless-meta="params.results1"}
{{< include _results1.qmd >}}
::::
:::: {.content-hidden unless-meta="params.results2"}
{{< include _results2.qmd >}}
::::
:::
## Computation
::: {.panel-tabset}
## General Results
Here are the general results.
```{r}
#| output: asis
#| echo: false
if (params[["results1"]]) {
cat("", "## Results 1", "{{< include _results1.qmd >}}", "", sep = "\n")
}
if (params[["results2"]]) {
cat("", "## Results 2", "{{< include _results2.qmd >}}", "", sep = "\n")
}
```
:::
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Similar to the answer above, I do with R. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there!
Thank you for the great tool! I have juste started using it and I was wondering if it was possible to show or hide tabs in the panel.tabset based on specific values present or absent in meta.
Here is my main:
And I would like to do something like this, to conditionnally display the "Results 1" tab or "Results 2" only if the values "result1" or "result2" are present in meta.
This code works when meta doesn't contain "result1" and "result2". However, when meta contains "result1" or "result2," the sections don't appear in separate tabs as expected but they're displayed in the same tab as "General Results".
Thanks in advance for your help,
Bests,
Célie
Beta Was this translation helpful? Give feedback.
All reactions