3 ms·
Nice writeup I faced the exact same problem, and came up with roughly the same solution, except with Markdown, Jinja, and my own static site generator. I need
by nicbou 4y ago
Nice writeup
I faced the exact same problem, and came up with roughly the same solution, except with Markdown, Jinja, and my own static site generator.
I needed to include calculators such as {% include "blocks/tableOfContents.html" %}, as well as constants like {{ MEDIAN_INCOME }}. These are inside the content, not at its edges.
Python-Markdown's approach is to store these tags somewhere, replace them with a placeholder, parse the content, then put the tags back, untouched. So the Markdown gets converted to HTML, but the Jinja blocks are untouched. The Jinja parser then renders those into the final template.