Skip to content

Slide Templating and Metadata #510

Answered by yhatt
spkane asked this question in Q&A
Apr 19, 2024 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

It could be achieved with making a plugin for Marp(it) with following logic:

  1. Register the estimated custom keys for placeholder as the custom global directives
  2. Add the inline rule of markdown-it to parse {{ xxx }} and replace with the custom placeholder token
  3. Append the core rule after the rule for parsing Marpit's global directives (marpit_directives_global_parse core rule), to replace the content of custom placeholder tokens with the value of global directives

Tip

Marpit will recognize only pre-registered directives while parsing Markdown. So it might be better to use the nested object definition within the pre-registered custom global directive if you want to allow the custom placeho…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by yhatt
Comment options

You must be logged in to vote
1 reply
@yhatt
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants