Coding 2025-03-17
I mostly took things easy today, but I did do a small amount of experimentation with the printer. I've now got a general idea of how I should expect things to fit together. Basically, there are a few natural groups of XML nodes, and they mostly do not nest, so I should rework things a little. I've bookmarked the relevant pages in the XML manual, so I should be able to throw something together, once I've re-evaluated the constraints on the layout.
And, let's see... some nodes are exclusive to page mode, some are exclusive to standard mode, some are shared, so I believe I want to have a common base class, and mode-specific subclasses, because some attributes are also mode-specific.
The big thing I need to ponder right now is how to handle stuff like <vline-begin> and <vline-end>, which are meant to be paired, but don't have to go in a particular order. This is something where I don't see an obvious way to handle it with closures or context managers. Like, I guess it's a linear logic sort of thing, but I'm not sure how to get that into any kind of easy Python paradigm.
Anyway, I think the right way to go about this is to make myself a checklist of all of the elements and their modes, and figure out what kinds of validators and enums I want to write for them.
Anyway, I need to get to bed right now.
Good night.