Replies: 1 comment 4 replies
-
There's a difference between "YAML directives" as defined by the YAML standard and YAML front-matter as defined by Pandoc. In YAML standard parlance, "document content" is actually just YAML.
Quarto (through Pandoc) expects YAML metadata blocks to use Pandoc's metadata syntax: https://pandoc.org/MANUAL.html#metadata-blocks Quoting the document, A YAML metadata block is a valid YAML object, delimited by a line of three hyphens (---) at the top and a line of three hyphens (---) or three dots (...) at the bottom. The initial line --- must not be followed by a blank line. A YAML metadata block may occur anywhere in the document, but if it is not at the beginning, it must be preceded by a blank line. But I'm not sure what you're asking. Is something not working in quarto itself? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Thoughout Quarto documentation, front matter is both started and ended with hyphens
Especially this is noted in Jupyter front matter. I'm primarily concerned with jupyter here.
However, YAML 1.2.2 states that:
So, essentially Quarto expects us to include two YAML documents (the second being empty) in the first raw cell...
Does Quarto allow the following front matter syntax, which is all valid single-document YAML:
---
[FRONT_MATTER]
...
[FRONT_MATTER]
...
[FRONT_MATTER]
My use case: I am doing a parser to modify single front matter attributes, using Python (
nbformat
+ruamel.yaml
). Round-trip parsing of the YAML withruamel
yields and additional--- [FRONT_MATTER] --- null ...
which is essentially correct.Beta Was this translation helpful? Give feedback.
All reactions