I think I know how to do that with stringIncludeTemplates.
please wait abit for a proof-of-concept.
I won't be pretty but should be pretty do-able, though with
abit of manual labor ...