Add option to allow yaml-file keys to overrule their duplicates in the frontmatter/overrule-by-default #6119
Replies: 1 comment 5 replies
-
Your issue is that you are using the Also, the limitation of
This is a direct limitation of Pandoc, see https://pandoc.org/MANUAL.html#reader-options. If you only need to modify few keys/values, use Alternatively, if you have different setup, you might want to look into project profiles and variables: Another approach, especially if you use |
Beta Was this translation helpful? Give feedback.
-
Description
Hello,
this might sound odd, so let's assume a very basic scenario. We have a simple document
with a default date and date-format.
Now, we convert it with to let's say
html
while feeding the following yaml file:This will result in the following output:
Referring to the documentation on
metadata-files
, frontmatter keys will overrule those fed via a yaml-file with the argument keymetadata-file
:To me at least, this doesn't make a lot of sense. Or rather, it is limiting where it doesn't need to be.
From my understanding, quarto will parse the frontmatter keys and then add any non-duplicate keys it will find in the yaml file. However, this brings home the simple disadvantage that you must outsource all keys you might want to change often (or vary between output formats) into the yaml file. So if you need to export to e.g. html, docx and pdf you must specifically define these keys in the yaml file for each and ensure that the frontmatter doesn't contain it.
But what if I need only a single file with a different value for that key? Say I need to hand in a report to three different places for review, and two people want a docx-file with a german-formatted date
DD.MM.YYYY
, while the third one rather had an html and needs the specific revisiondate-format: "rev. DD.MM.YYYY HH:mm:ss"
.Instead of setting the general assumption to the frontmatter and specifying the deviation when converting to html in its respective yaml-file, I now need call quarto at least twice; and manually edit the file inbetween.
I don't know, that seems unnecessarily complicated to me.
If yaml-file keys would overrule frontmatter ones, this would not be an issue. From my perspective, the negative aspects are almost nonexistent, this would only result in perceived-wrong output if the user uses a random yaml file and doesn't know what keys they are overwriting at-random while doing so. That is an extremely unlikely scenario.
In principle, this would (and imo should) be applicable to all format-agnostic keys.
I hope I could explain my confusion here well enough.
Thank you,
Sincerely,
~Gw
Beta Was this translation helpful? Give feedback.
All reactions