I’m pretty sure I won’t be able to implement this idea but I’m still curious what it would take:
I want a +
(or possibly a §
, and possibly preceded by empty row) at the start of a row to be a wikitext command that renders the text as collapsible/expandable. Wikitext, NOT a widget or a macro!
The targeted content should be everything from the +
until the next row-prefixing occuence of it, or end-of-tiddler. No closing marker/tag!
Nestable
If the prefix is ++
, then this is a “child” to the +
parent, and will thus also be hidden if the parent +
is collapsed. (This is comparable to the wikitext for ordered/unordered lists i.e #
and *
)
Hierarchical numbering
Further, the rendered view automatically numbers the sections hierarchically. The following shows what this means:
1
1.1
1.1.1
1.2
1.2.1
2
Toggle button
In view mode, that number (and possibly the “label”, see below) serves as a toggle button to expand/collapse. (Alternatively, an explicit +
button.)
Label
If the +
is followed by a blank space character (
), there is no label next to the rendered button. If there is no space, then the label is the string up to the next space character (e.g +mylabel notlabel
). And for spaced labels, another +
character, that is not a prefix to a new row, marks the end of the label. For example (as seen in editor):
+These words are a label all up to here+ but not these words, which are instead content in the collapsible section.
+BUT this section only has the word "BUT" as label since there is no end marker in the same row, so these very words are instead content.
(As are these words, i.e they're also content to the "BUT" section.)
…so, what would it take to create something like this? I know 5.3.0 brought with it some new possibilities but I’m guessing js would still be needed, right? And, yes, I know it is not “backwards compatible” because of the multitude of users prefixing their sentences with +
signs.
Did I clarify wikitext not a widget or a macro?