Creating a custom template

Greetings. Wondering if it is possible to create custom template (like md and html), to support a DSL, so that I can do something like:


which would then be passed through the js function that interprets that DSL to output plain text, or html, or markdown or whatever…

if so, pointers to documentation or source code doing similar would be great!

These are called tagged template literals and you can write your own:


perfect, thanks