Coding 2024-09-26
Okay, here we go again. I've got the code just about put together to generate stylesheets. What I'm missing is, in essence, a good idea of the kinds of stylesheets I should be generating. I'll try walking through my thoughts around this and see if I get anywhere...
I'm writing and styling HTML here, but the whole purpose of all of this is not to lay out anything for display on the web, but to put together a PDF document. So, I want to be thinking about this all as "a document" which is divided into "pages". "A page" will have content, stuff outside the content, and I guess that's it. The "outside" stuff will live on the document and get styled into the page.
Looking at it like this, I think this will be pretty flat from a BEM perspective. "Document" is a block, and many of the sub-elements will simply be elements directly under "Document". (Or maybe a "Page" is both a block and an element, or just a block, and all of the other elements live under Page? ... That probably makes more sense.)
If I assume that this is a good idea, then there needs to be some way to create these elements in a nested structure, and then pass that into the templating system to render it all to HTML. I've got stuff to handle the class names, but not the tag names. svgwrite generates XML...
I think I need to have the body class be a template argument, and the rest of the content is passed in as a kind of forest that the template just renders recursively-ish. I definitely need to take some more time to think about this. In what I have in mind right now, the different concerns seem either, not separated, or at least very jumbled up.
I'm going to leave it there for now.
Good night.