Thank you both for the additional perspective. I can see a trade-off in the relative merits of a general purpose language (e..g Lua) vs mini-DSL (templates), but for me the general language would win as soon as there's a non-trivial amount of manipulations to perform. Of course this will be a matter of personal taste more than anything (until something turns out to be impossible, and the DSL needs to be augmented). A key advantage of the programming language approach, in my view, is that any complexity can be captured inside a function. Specifically, I'm looking at the heavy pre-processing done in Quarto[^1] to thoroughly normalise the author-affiliation metadata, including tasks such as identifying unique affiliations (maybeAddAffiliation() is an example of wrapping non-trivial operations in a convenient function), grouping authors by unique affiliations with unique IDs, etc. Doing all this without the facilities afforded by Lua would seem unsurmountable to me. And then, if one has already gone 99% of the way in Lua by producing the right AST structure, it seems easiest to me to carry on with Lua and have a custom partial writer or filter insert the final \author{}...\affiliation{} strings in the output. Admittedly, this is a rather extreme situation, where a lot of manipulations need to happen between the relatively free-form metadata and the output. Best regards, baptiste [^1] https://github.com/quarto-dev/quarto-cli/blob/ad4281d71317c6a491434a080a408de2aff789a4/src/resources/filters/common/authors.lua#L346 On Wednesday, 5 April 2023 at 04:00:18 UTC+12 Albert Krewinkel wrote: > > BPJ writes: > > > A program doing the same job as a template will be full of string > > concatenations and format strings which will look disconnected in > > a way which template text will not. This was the original use case for > > templates before security and separation of functions were big > > concerns, and it is still valid. > > My favorite example to reinforce this point is PHP: it's already really > easy to use PHP in HTML templates, and yet, people wrote extra template > languages in PHP (e.g., https://smarty.net) because those were more > pleasant to use. > > > -- > Albert Krewinkel > GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1251527d-ba92-406f-a3e2-3009190253d3n%40googlegroups.com.