You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to do parametrised analyses modules, which would be conditionally evaluated affecting both titles and chunks, so that the titles aren't printed on the output but are still on the .qmd file for navigation purposes.
I have already tried the combination of :::{.content-hidden when-meta="params.pca"} & {r} #| eval: !expr !expr params$pca without success, specially when working with {{< includes ... >}}.
The following option also is not what I want because it'll make the title not available for navigation:
#| output: asis
cat("\n\n## My second level header\n\n)
Now I am trying to create my own shortcode or lua filter that achieves this purpose.
This is currently my first attempt, any help it'll be welcome:
conditional-evaluation.lua
functionMeta(meta)
modules=meta.params.moduleor {} -- Access the 'module' field in YAMLendfunctionDiv(el)
localmodule_name=el.attributes['module']
ifmodule_nameandmodules[module_name] ==falsethenreturn {} -- Hide contentendreturnel-- Otherwise, render content as usualend
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Description
I want to do parametrised analyses modules, which would be conditionally evaluated affecting both titles and chunks, so that the titles aren't printed on the output but are still on the .qmd file for navigation purposes.
I have already tried the combination of
:::{.content-hidden when-meta="params.pca"}
&{r} #| eval: !expr !expr params$pca
without success, specially when working with{{< includes ... >}}
.The following option also is not what I want because it'll make the title not available for navigation:
Now I am trying to create my own shortcode or lua filter that achieves this purpose.
This is currently my first attempt, any help it'll be welcome:
conditional-evaluation.lua
analysis.qmd
module-dimred.qmd
Beta Was this translation helpful? Give feedback.
All reactions