We have a bunch of Nim types/procs that get generated based on some external data. That all works well, including pulling in the doc comments when running nimdoc.
The main issue with the generated doc is that it is all in the same file as whatever module that runs the macro to load the external data. It would be nice to find a way to split this up.
For example if you generate typeA, typeB, typeC, etc. along with procs that work on those types, I would like to generate something like typea.html, typeb.html, typec.html. It doesn't appear possible to insert macro generated code into a separate module though. From glancing at the compiler code, modules seem like they have to come from files that exist somewhere in the filesystem.
One possibility that might work is to use toStrLit to write the macro generated code to temp files and then run nimdoc on the temp files.
Any other suggestions would be welcome.
Thanks
This package runs a macro and both consumes and renders the result to a file. It seems to do what you want; maybe it will inspire an even better solution: