At Stripe, we built Markdoc to solve many of the issues mentioned!

https://stripe.com/blog/markdoc

This feels like Markdown + Liquid.

I wrote quite a bit about Fluid, which is the C# implementation of Liquid. https://deanebarker.net/tech/fluid/

Nice. But reminds us that most templating languages support markdown by default.