Replies: 3 comments 4 replies
-
Creating a format extension with new YAML meta data (parameters) that you inject seems more straightforward to me (https://quarto.org/docs/extensions/lua-api.html#html-dependencies). |
Beta Was this translation helpful? Give feedback.
-
I don't think there's an easier way, because ultimately you're trying to connect YAML metadata semantics (which is visible in Lua and in template expansion) with CSS semantics. Something, somewhere will need to put the former in the latter. Template expansion, as you've found, seems to be the least clunky way to do it. |
Beta Was this translation helpful? Give feedback.
-
FYI the related opened issue #5982. |
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
I may be taking a very weird approach here, but here's a situation I encountered today:
I have a custom Html template, say for Gandalf's resumé,
and I wish to define the font colours in the Yaml header with something like:
where the
fontcolor
follows the standard Quarto convention, but I could not find a built-in way to specify other colours, such as the "highlight" / "accent" (red, in this case). Changing this colour in the Yaml (and nowhere else) lets me get a different style:Pandoc variables cannot be inserted into my custom CSS file (defining
<h1>
, etc.), but I figured I could inject this custom Yaml variable indirectly by referring to CSS variables:and defining the variable in a custom template partial (where pandoc variables can be injected):
This seems to work, but I wonder if I've missed a much more direct strategy? I came to this from a similar workaround in Latex (with macros instead of CSS variables), so it's very possible that I missed a more natural solution.
Beta Was this translation helpful? Give feedback.
All reactions