Wondering whether it's possible to pass content like:
<div class="TestHeader ">
<span class="TestCounter"></span>
<span class="TestComponent">TestBoxLeft</span>
</div>
To a nunjucks macro? So if the above content could be inserted into a variable called content the macro could be called like this:
{% import "insert.njk" as insert %}
{{ insert.content( content ) }}
{% macro content() %}
foo {{ caller() }} bar
{% endmacro %}
{% call content() %}
<div class="TestHeader ">
<span class="TestCounter"></span>
<span class="TestComponent">TestBoxLeft</span>
</div>
{% endcall %}
@devoidfury THAT'S VERY COOL - Thank you! I played around with a mini prototype that can be found here in case anyone else needs to do something similar. In my case I'm planning on rearchitecting superflycss/cli to generate tests like these using the nunjucks macros. Right now I'm using JSDOM to copy the markup content to another section so that the markup example section can be syntax highlighted, and now it looks like I can cut out the JSDOM manipulation and use pure nunjucks. Thanks again!
Most helpful comment
https://mozilla.github.io/nunjucks/templating.html#call