Replies: 1 comment
-
After this MEP has been implemented, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Rationale
The option
jekyllData
enables YAML streams to generate YAML metadata renderers, which can be redefined for event-driven processing of complex YAML documents. For simpler YAML documents, the\markdownSetup
keyjekyllDataRenderers
offers an alternative with less control but simpler syntax; see sections 2.2.6.1 and 3.2.3.2 of the technical documentation.In cases of medium-complexity YAML documents,
jekyllDataRenderers
may not provide enough processing control, often necessitating manual redefinitions of YAML metadata renderers. A recent article, Markdown Themes in Practice from TUGboat 45:2, illustrated that redefining YAML metadata renderers to route processing to expl3 key–values can be beneficial, an idea aligned with @TeXhackse's suggestion at #77 (comment), which we ultimately didn't implement in #77. Adding standardized support for routing jekyll data to key–values could simplify the handling of medium-complexity YAML documents.While key–values are typeless, YAML values have types, which are accessible through YAML metadata renderers. Furthermore, whereas key–values only accept a single value for a key, the Markdown package provides two representations of string values:
Our routing should also preserve type information and provide access to both representations of strings.
Proposal
Add a new
\markdownSetup
keyjekyllDataKeyValue
that specifies the key–value ⟨module⟩ to which all jekyll data is routed.For every YAML key
path.to.
⟨key⟩ with a value of type ⟨non-string type⟩, set the key ⟨non-string type⟩ of the key–value ⟨module⟩/path/to/
⟨key⟩ if it is known and the key ⟨key⟩ of the key–value ⟨module⟩/path/to
otherwise. ⟨Non-string type⟩ is one ofboolean
,number
, andempty
. For the ⟨non-string type⟩ ofempty
, no value is passed to the key–value. Therefore, a default value should always be defined for nullable keys using the key property.default:n
.For every YAML key
path.to.
⟨key⟩ with a value of typestring
, set the keystypographicString
andprogrammaticString
of the key–value ⟨module⟩/path/to/
⟨key⟩ if they are known with the typographic and programmatic strings of the value, respectively. Furthermore, set the key ⟨key⟩ of the key–value ⟨module⟩/path/to
with the typographic string of the value unless the keytypographicString
is known. If the keyprogrammaticString
is known, only set the key ⟨key⟩ if it is known. In contrast, if neithertypographicString
norprogrammaticString
are known, set ⟨key⟩ normally, i.e. regardless of whether it is known or unknown.Examples
Processing YAML metadata in LaTeX:
Beta Was this translation helpful? Give feedback.
All reactions