Wednesday, November 15, 2023
Markdown itself does not support variables directly. Use pre-processors like Jekyll
, Pandoc
, or Markdown Preprocessor (MPP)
for variable support.
Variables in documents can greatly enhance the flexibility and reuse of the content. However, Markdown's simplicity means it doesn't natively support variables.
To use variables in Markdown, you'll typically employ a pre-processor or a static site generator that supports Markdown.
---
name: John Doe
---
Hello, my name is {{ name }}.
pandoc --variable=author:"John Doe" -o output.docx input.md
While Markdown doesn't directly support variables, using tools like Jekyll or Pandoc allows you to add dynamic content to your Markdown documents. This approach leverages the simplicity of Markdown while adding the flexibility of variables.