I think this is something of a tricky one, since it goes a bit against the grain of what Twine is meant to be. I have a project that is mostly linear, but with optional "sidetrips", generally or always only a passage long, that return to the main flow. What I'd like to be able to do is generate a browsable index of all of the passages in the project, in reading order.
The difficulty is that, even though the passages are organized in my source in reading order, the story's passages end up in the storage-area in something very close to random order (at least when you compile with Twee + SugarCube, as I am doing). I am having a hard time coming up with a way to capture the order aside from keeping a manually compiled list of the reading order. Is there a way to generate a list of passages that would capture them in roughly the same order as my source code?
I use a <<continue "next passagename">> macro in every passage to create a button that brings the reader to the next passage, so I could write a routine that would do a brute-force "read-through" of the passages in the store-area to compile the right reading order. And probably that's what I will have to do--but I'm wondering if there might be a gentler way?
Comments
Another option could be to use a simple script to extract all the passage names from the source and put those in a passage by themselves. That could be easier to parse than parsing full passages, although it adds an extra step to the build process (not really an issue if you use a Makefile or script to build already).
Alternatively, tweego might work for you, it maintains the source to output ordering of the passages by default.
Indeed, maybe I should just patch tiddlywiki.py to preserve the order and create a pull request to make it the new default.