Unclear how to access array elements in {{< meta >}}
#6764
-
DescriptionThe quarto documentation explains how to use metadata within the document, and also how to access nested values using the dot notation: https://quarto.org/docs/authoring/variables.html. However, it doesn't explain how to access array/list elements, and indeed I can't find a syntax that supports this. In the following document I show my attempts to do this:
This renders to PDF like this, showing that none of my attempted array accesses worked: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It is currently a limitation of how shortcodes works - it does not support yet arrays or maps. It is not mentioned in the doc, but I can see reference of this limitation in our code comment quarto-cli/src/resources/filters/quarto-pre/shortcodes-handlers.lua Lines 126 to 130 in a67ae2a I'll open an issue to track this as possible improvement. cc @dragonstyle |
Beta Was this translation helpful? Give feedback.
-
This will be possible in 1.4 now using the following syntax ---
top: "Top Lvel"
nested:
str: "Nested String"
array:
- foo
- bar
---
{{< meta top >}}
{{< meta nested.str >}}
{{< meta nested.array.1 >}} It will be available from v1.4.535 |
Beta Was this translation helpful? Give feedback.
This will be possible in 1.4 now using the following syntax
It will be available from v1.4.535