How do I convert Markdown a YAML key:value to Typst output, when the value is sometimes wrapped in quotes, sometimes not? #10947
-
Hello. I am trying convert a key:value pair in my Makrdown YAML to Typst output, using a template. I am trying to set a numbering pattern for headers through a key-value pair: I need to detect when the numbering value is specifically This is the code in my template to convert, via template, from Markdown to Typst:
I want to achieve the following:
With the assistance of Claude Code, the only solution I’ve been able to arrive at is to use a Lua filter:
However, I would rather not have to remember to depend on this lua filter, if at all possible. I’d be grateful for any guidance. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The LLM is right in this case, and I don't see any simpler way with the constraints you've given. If possible, use |
Beta Was this translation helpful? Give feedback.
-
@tarleb -- an @fungai2000 -- don't forget that command-line settings can be set up in a defaults file, so you can add the filter to a defaults file (store din your pandoc data dir) then just call |
Beta Was this translation helpful? Give feedback.
This works perfectly and indeed keeps it in the template without needing another lua filter. Thank you!