This is interesting. So it's HTML -> PDF without using Chrome/Puppeteer etc.? Is that correct. It reminds me of https://weasyprint.org/
Weasyprint (by their own admission) have really struggled with a lot of bugs, which isn't surprising if you're allowing arbitrary HTML input - how are you getting on with that?
InDesign is awesome. Anyone designing a general purpose document language should spend a lot of time in InDesign first. LaTeX should not be your mental model.
Agreed, it's about _imperative_ vs _declarative_ languages.
The problem with languages like LaTeX etc. is they treat a document as a linear sequence of instructions: "write this text", "switch to justify right" etc. - I think that made sense when LaTeX was created, but publishing has come a long way and imperative thinking doesn't help.
A declarative form of document is the way forward. HTML is -kind of- like that, but unfortunately the assumption that a document is a linear list of stuff is still in there. That's one reason it doesn't work well for print.
Weasyprint (by their own admission) have really struggled with a lot of bugs, which isn't surprising if you're allowing arbitrary HTML input - how are you getting on with that?