You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.
A while ago I wrote yamlp, a YAML preprocessor that performs string variable interpolation. The app was written because Pandoc does not have a way to perform variable interpolation itself. However, despite having a standalone YAML preprocessor, it makes the tool chain all kinds of awkward (piping Pandoc into itself). I've written up a section on how to use yamlp as part of my series on Typesetting Markdown.
From a higher vantage point, YAML is merely one type of structured document format that can be used for interpolated variables. In theory, any hierarchical data could be used, as shown in the following architecture diagram for Markdown editors:
It would be spectacular if there was a way to have PP perform the preprocessing of Markdown that includes interpolating and injecting variables from structured data formats. Consider:
a: A b: $a$ B c: $b$ C $b$d: $a$ $b$ $c$ D $a$e:
f:
g: Gh: H and $e.f.g$
If PP's input Markdown document was:
Hello $h$ and $d$.
After running PP, the Markdown document for Pandoc would resemble:
Hello H and G and A A B A B C A B D A.
Various variable name delimiters and internal separator tokens, such as {{ and }} and ., should be configurable as well. This would allow for many variable syntaxes, including R Markdown.
The text was updated successfully, but these errors were encountered:
Sorry for the late reply... Please keep in mind that pp is not supported anymore, it's hard to deploy. For new projects I suggest ypp which is is based on a Lua interpreter and way easier to compile and install and binaries are easier to produce (thanks to zig) and deploy (see hey).
This can be done with ypp and some Lua YAML parser. Or even with ypp and Lua tables.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
A while ago I wrote yamlp, a YAML preprocessor that performs string variable interpolation. The app was written because Pandoc does not have a way to perform variable interpolation itself. However, despite having a standalone YAML preprocessor, it makes the tool chain all kinds of awkward (piping Pandoc into itself). I've written up a section on how to use yamlp as part of my series on Typesetting Markdown.
From a higher vantage point, YAML is merely one type of structured document format that can be used for interpolated variables. In theory, any hierarchical data could be used, as shown in the following architecture diagram for Markdown editors:
It would be spectacular if there was a way to have PP perform the preprocessing of Markdown that includes interpolating and injecting variables from structured data formats. Consider:
Given a YAML source document such as:
If PP's input Markdown document was:
After running PP, the Markdown document for Pandoc would resemble:
Various variable name delimiters and internal separator tokens, such as
{{
and}}
and.
, should be configurable as well. This would allow for many variable syntaxes, including R Markdown.The text was updated successfully, but these errors were encountered: