Remix.run Logo
tiagod 3 hours ago

I've written a system that consists of a JS front-end/backend, which then feeds a json object to a typst template to generate PDF reports with hundreds of pages, multipage tables, references to bibliography within the json strings, and translated to multiple languages. It works extremely well, and it's very intuitive to work with it.

For example, for the translations, I just made an object with every piece of text in a hierarchical structure, with the leaf being an object with keys for every language and the texts as values. Then I have a function called t() that is created after we already know the language for this report that just extracts the current language string when given an object like #t(content.section1.subsection.header.title) in the main report template (which imports this translations object from another file)

For bibliography references, I just have a regex for __REF\d+ that will replace all those references with real bibtex references.