I’ve been working with DocAssemble recently, an open source document assembly application. It automates templates using Markdown and Python, with interviews written in YAML. The YAML syntax has a learning curve. It’s a very polished project with comprehensive documentation.