Usaríamos Typst para crear el documento, en un proceso como
https://github.com/typst/typst/blob/main/crates/typst-cli/src/compile.rs
that's how typst-cli drives it
it's a little different cus typst-cli has a bunch of nice interface stuff
Seems like you need to create a world, call typst::compile, then typst::export, aaand that's it
https://github.com/typst/typst/blob/main/crates/typst-docs/src/html.rs#L433
here, this seems like the thing most similar to what you want. The Doc world has some constant fonts and libraries and stuff, and uses a custom source. No reading from files, just building the fonts and standard library statically :
Usaríamos Typst para crear el documento, en un proceso como