I want to post-process the SVG output from Typst. Specifically, I want to annotate different parts in the Typst source document and be able to identify and extract these parts from the generated SVG. Is it already possible with the current supported features?
- Ideally, I can make groups with unique labels. The grouping should then be preserved by the Typst compiler, and the unique labels for the groups should become e.g. "id" attributes in the SVG.
- If preserving the grouping is not possible, the following would also work for me. If a group is inlined, the label for that group is transformed into e.g. "class" attributes and gets attached to the children elements.
I checked the source code and saw that there areFrameItem::Metaelements which seems to provide the required information, but I got lost when tracing where theseMetas are generated and transformed (because apparently the group structure is flattened and theMetas get duplicated in the finalFrame).