Today I'm playing with Pollen, a 'programmable publishing system'. It lets you intermingle prose and code definitions. https://docs.racket-lang.org/pollen/Backstory.html Racket promotes defining new languages, so it's a great fit there. The syntax feels lighter than TeX too.