So... I'm trying to do the same but for Zig and with Typst. Of course I kinda gave up on the idea due to overwhelming headache on and over complexity. The process is similar to how currently Zig generates its HTML, it relies on a WASM and bundle the sources to read each and it's basically a SPA. The part that annoyed me was dependencies of a single module (a Zig project is composed of a many modules (a module is a library or an executable), as the HTML one bundles the module dependencies plus the standard library. If I just focus on the single module serialization to compile it into a PDF, that works perfect, but it breaks the reference to given dependencies and standard library API. Say for internal dependencies or external ones, but the serializing (the module sources) the standard library is somewhat huge XD. How does Nim handle this?