Coding 2024-02-15
Okay, I can't really do too much today, but let's see what I can work out for later.
I want to write a Python script to generate my build.ninja file. In service of this, I have installed the "ninja_syntax" package. The key thing for me to use from that package is the Writer class, which requires an object with a write(str) method, and a close() method. A text file, basically. I have a set of rules and build statements to generate. My initial thought is that I should have some kind of helper method for the build statements, so I can just call some_object.pandoc("story.rst", output="build/story.html").
The idea of wrapping these disparate objects around each other like a matryoshka doll is making my teeth itch a little. Kind of makes me want to replicate the Compendium creation code from MOTR, but that's probably extreme overkill, and yet...
... I have just discovered that the interface to ninja_syntax has changed somewhat over the versions, and I assume I should probably just vendor a version that matches my installed version of Ninja.
...
Okay, after vendoring the file and doing the thing, I should be all set to start writing code to generate a build.ninja file. Sadly, it is late and I am feeling bad in addition to feeling tired, so I'm going to go lie down.
Good night.