Placeholder variables for text snippets in markdown

Viewed 1383

I'm trying to write a markdown document that contains something like a centrally specified placeholder variable which allows to propagate a certain text snippet to different locations of the document, e.g.

placeholder = markdown files
This is my text about %placeholder%. %placeholder% should be used by everyone.    

Unfortunately, after some research, I did not found a way to realize this behavior.

I'm aware of the reference-style links functionality of markdown. However, from my point of view, it does not seem to solve exactly the issue I'm facing. Further, https://www.brianchildress.co/variables-in-markdown/ described an approach that perfectly fits to my question. However, the variable random value of the provided demo code is not replaced in the text.

I would be glad for any suggestions or at least the hint that the requested feature is not available.

1 Answers

That blog post is simply wrong. Reference-style links aren't variables, and they don't behave as described there.

One of Markdown's guiding principles is that files should be readable in their source form:

Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.

Placeholders conflict with that principle and are not included in Markdown.

Related