I actually think that the labels you have there are just fine for labeling them. An alternate version might be A: Winding Demo 1.1.2
, but I think just as you have them is fine. Use captions if you want a more pleasant display of their titles. One big advantage of the style you have now is that you can derived the hierarchy directly from the titles. No need to fiddle with parent
fields or children
list fields.
If you do go this route, then we can have straightforward answers to this question:
We can use code like this:
<$let
question={{{ [<currentTiddler>removeprefix[A: ]search-replace::regexp[(\/\d+)+$],[]addprefix[Q: ]] }}}
parent={{{ [<currentTiddler>search-replace::regexp[\/\d+$],[]] :filter[is[tiddler]] }}}
>
to derive the Question and (when applicable) the parent from any part of a template for Answer tiddlers.
And we can get the children of any question or answer with a function like this:
\function get.children(ans)
[prefix<ans>] -[<ans>]
:filter[trim:prefix<ans>regexp[\/\d+$]!regexp[\/\d+\/\d+$]]
+[format:titlelist[]join[ ]]
\end
If we wanted, we could write some recursive tool to show the entire hierarchy of a Question and its Answer(s), perhaps highlighting the current node, and put the result in the footer of each tiddler. I didn’t go that far, but I did create a little demo you can try: QandA.json (2.4 KB)
Here’s how a few of the tiddlers look:
Only a few of the tiddlers have captions, but that’s easy to remedy. If you’re interested in the kind of hierarchical view I mentioned, let me know if you need help. I’ve done things like it a few times.