Coding 2024-02-14
Me several months ago: "Why does the Ninja documentation warn you against hand-writing the files? This is really easy and pleasant."
Me now: "The prospect of writing rules for anything remotely tricky makes my skin crawl. ... Oooh..."
So, yeah, I'm at a bit of a juncture here. Either I can write code to generate some gnarly nonsense for Ninja to work with, or I can try out something else, like, see if tup acts any nicer when I have ideas like "well, I might want to change the code to translate the draft between different formats, and that should force the build to redo, so I guess I've got to write files like—"
rule python
command = python $args > $out
build build/preface.rst: python build.py draft.leo
args = build.py --section preface draft.leo
Or however Ninja works, I didn't actually try that out, in part because build.py isn't fleshed out enough to do that yet.
In any case, I think I basically understand how to try and put stuff together for generating Ninja code, which makes it somewhat unfortunate that I feel kind of bad right now actually, and just want to go lie down.
Good night.