Repository navigation
Open
Labels
Milestone
Description
Bug description
In 1.3, I could include a {{< kbd ... >}} within the _variables.yml file and use {{< var ... >}} with it. Now, in both 1.4 and 1.5, it doesn't work as previously.
Steps to reproduce
Create a new simple Quarto Project with RStudio.
In the index.qmd file, include:
---
title: "test"
---
{{< var test >}}
{{< kbd mac=Cmd-Shift-P win=Ctrl-Shift-P linux=Ctrl-Shift-P >}}In the _variables.yml file, include:
test: '{{< kbd mac=Cmd-Shift-P win=Ctrl-Shift-P linux=Ctrl-Shift-P >}}'And render it.
Expected behavior
It should print something like Ctrl-Shift-P twice (in this example).
Actual behavior
Instead it looks like:
mac=Cmd-Shift-P
Ctrl-Shift-P
Your environment
- RStudio 2023.06
- Quarto 1.5 (and tried on 1.4 as well)
- Ubuntu 22.04
Quarto check output
Quarto 1.5.31
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.13: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.5.31
Path: /opt/quarto/bin
[✓] Checking tools....................OK
TinyTeX: v2023.05
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /home/luke/.TinyTeX/bin/x86_64-linux
Version: 2023
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.10.12
Path: /usr/bin/python3
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking R installation...........OK
Version: 4.4.0
Path: /usr/lib/R
LibPaths:
- /home/luke/R/x86_64-pc-linux-gnu-library/4.4
- /usr/local/lib/R/site-library
- /usr/lib/R/site-library
- /usr/lib/R/library
knitr: 1.46
rmarkdown: 2.26
[✓] Checking Knitr engine render......OK
Activity
cscheid commentedon Apr 30, 2024
Hm. That's unfortunate.
The problem here is that what you had worked by accident. The order of resolution of shortcodes is not something we can easily promise (because what works for you can just as easily break for someone else).
I understand why you'd want to do this, but I wouldn't recommend using nested shortcodes. Can you say something more general about what you're trying to achieve? There might be another way to do it.
lwjohnst86 commentedon Apr 30, 2024
Hmm, well, the reason I want to use
varshortcodes is because it is a pain to have to write out fullkbdfor all the shortcodes within an e.g. website or book. Having a simpler way to "not repeat myself" would be nice. I don't know of another way to handle that.cscheid commentedon Apr 30, 2024
I hear you. Include shortcodes could work if you're repeating things at the level of a paragraph (includes are special and resolved differently from other shortcodes).
I'd love to fix the general class of problems, but I have to think harder about how to go about it.