The Way of the Book

my sanity will break if I have to go through nearly 400 files by hand.

a screenshot of python code, a lot of regular expressions with square brackets and backslashes

As mentioned a few times before, about 3.5 years ago, I've started writing a new roleplaying game, Raiders of Arismyth.

By now, it is, well, sorta, mostly, nearly, done. And it's not just a small zine: 54.564 words across 387 files and 37 folders, plus lots of pictures and illustrations inside an Obsidian.md vault

And now that there's "only" proofreading, editing, and careful additions in the form of gameplay examples and more fleshed out tables left, I look towards the next step:

Layout

I'll be honest: Layouting text isn't my strong suit at all. As so often, I recognise bad layout, but I cannot do it myself.

Right now, my plan is to compile the whole text into something cohesive that can be easily transformed, converted, and imported into whatever layout workflow I'll encounter, maybe throw it into typst or LaTeX.

And to do that, I have to pull those 387 files together into ideally one single file. Or at least one text file and one folder for all the other assets.

Some of the challenges for this are

  • I have one index file that lists all the main chapters
  • each main chapter then has about a dozen sub-chapters, each a file
  • all these files are spread over 37 folders
  • all skills, spells, glossary entries, creature descriptions, and so on are separate files that are only linked to but not embedded in any of the other files
  • the files have copious cross-links to find related topics and so on
  • Obsidian doesn't always add the whole path to a link, because often enough it can do "magic" matching. The engine knows all filenames, so if there is the correct filename somewhere in the vault, the link works. That is nice for editing, but a nightmare for compiling everything by a script.
  • some of the illustrations are made with text-mapper, which isn't easily plugged in to any automatic workflow out of the box
  • the links inside the vault come in both markdown and the wiki flavours
  • I wasn't, over those 3.5 years, that consistent in terms of the headings hierarchies, and sometimes the filename is supposed to be the heading, sometimes there's an extra heading at the beginning of a file
  • Some of the Obsidian plugins I've been using have littered the text with metadata.

And I know that I won't be able to do all this by hand - because I will need to re-edit the text and move it around quite a few times before it'll be really finished. And my sanity will break if I have to go through nearly 400 files by hand.

But a script won't be easy either - I've used Lumo to help me work out some specification, and that file is already about 38kb big, and me not being a developer isn't helping either :)