How can I back up my 2FA recovery codes with Typst?

Hello Typst community!

So, I have been using Typst lately for very basic documents that do not require advanced layout settings. And it has done its work perfectly so far!

Now I want to create a more advanced template that allows me to generate a print-ready PDF with the recovery codes for all the accounts I have 2FA enabled for. I have been considering the following aspects:

Layout

The layout of the page should be something like a 2x4 grid. In each grid, then, the recovery code for one account.

Format of the exports

They are normally exported as a TXT file. However, the content and alignment may vary a lot depending on the service. So, I was thinking of parsing most or all of them to a CSV externally before delivering them to Typst.

Dynamic subgrid adjustment

Once parsed to CSV, I would like a function within Typst that automatically recognizes which layout is the best for the inner grid. This has to do with how many columns and rows should be used in relation to the available space (within the cell of the 2x4 grid). This should also be dependent on the quantity of entries of each file.

Does someone have experience working with the elements required for this layout and could give me some ideas on how to implement it? Or even if it is currently a good idea to do this with Typst (since it is a project still in development, so it might not yet have the required tools for this)?