so

XML Typst

Volume 10, Issue 14; 17 Mar 2026

An experiment in typsetting from XML with Typst.

Last week, I described an idea I had for modeling Typst with XML. I spent a few more evenings exploring those ideas and pushed it to a public repository: https://codeberg.org/ndw/XMLTypst. A bit more effort would be required to make it into something practical, but it seems entirely possible.

The repository contains the model framework and a couple of toy stylesheets for publishing from (tiny subsets) of HTML or DocBook with Typst.

In the end, I wanted more information from the Typst documentation than I was conveniently getting with Invisible XML, so I replaced that with an XProc pipeline that operates directly on the markup in the Typst documentation pages. (That allows me to extract information about settable properties and required properties that isn’t available in the function signature alone.) The actual Typst documentation sure seems like it’s at least partly generated from some other description of the data model, but a quarter of an hour poking around the Typst repo did not lead me to it.

That was a nice exercise in puzzle pieces as well, though. XProc happily loads HTML where it’s easy to query and transform with XSLT before writing out the results you need.

(I’m on holiday for the next couple of weeks, so there may be more pub signs than markup posts in the immediate future, but I’ll see what I can manage next Monday!)

#DocBook #HTML #MarkupMonday #XML #XProc

Please provide your name and email address. Your email address will not be displayed and I won’t spam you, I promise. Your name and a link to your web address, if you provide one, will be displayed.

Your name:

Your email:

Homepage:

Do you comprehend the words on this page? (Please demonstrate that you aren't a mindless, screen-scraping robot.)

What is six plus six?   (e.g. six plus two is 8)

Enter your comment in the box below. You may style your comment with the CommonMark flavor of Markdown.

All comments are moderated. I don’t promise to preserve all of your formatting and I reserve the right to remove comments for any reason.