The code generation in version 3.1, uses multiple fprintf() statements to generate the output files. This makes the code hard to read and follow.
An approach having the full file template as a string would be easier to read. The template string could also have markers to trigger custom code generation. Markers could be formatted such as {pi} from the fmt library examples.