With the help of several community members, I have created an alpha version of a simple plugin to add previous
/next
navigation to an ordered subset of tiddlers. You can see it at Wizard Nav Demo — A simple previous/next navigation for a group of tiddlers.
As well as a stylesheet tiddler, I have $:/plugins/scott-sauyet/wizard-nav
, which contains
<$set name="currentNavStep" value={{!!title}}>
<$list filter="[is[current]tags[]tag[$:/plugins/scott-sauyet/wizard-nav]sort[]]">
<div class="wizard-nav">
<div>
<$list filter="[enlist{!!list}before<currentNavStep>]">
<$link to=<<currentTiddler>>>« {{!!title}}</$link>
</$list>
</div>
<div><$link to=<<title>>><<currentTiddler>> ^</$link></div>
<div>
<$list filter="[enlist{!!list}after<currentNavStep>]">
<$link to=<<currentTiddler>>>{{!!title}} »</$link>
</$list>
</div>
</div>
</$list>
</$set>
<$list filter="[is[current]tag[$:/plugins/scott-sauyet/wizard-nav]]">
<<list-links filter:"[all[current]tagging[]]">>
</$list>
It’s working to my current needs, but I have many questions. If anyone has time to answer any of them, I would appreciate it. They are in that demo, but here they are again:
-
Is this something useful to anyone but me? I have a need for this, and as it stands, this seems good enough for what I want. I have no idea whether after fixing up the outstanding issues I should try to put this someplace more prominent so others can find and use it.
-
Is there a good way to pick up the color of the border line from the user’s theme? And if so, is there a standard named property that would make sense?
-
Is this breakdown into just two tiddlers appropriate? I have one that is simply a stylesheet, but the other serves as a
ViewTemplate
and its name also serves as the tag name pathways have to use. I have no idea if that is common, is unheard of, or somewhere between. Is there another more logical breakdown? This concerns me mostly because"$:/plugins/scott-sauyet/wizard-nav"
is a mouthful, and I’m not sure that I would want to require users to use it, but that seems to be the most common namespacing technique for plugins. If I just required them to tag their tags with “Wizard”, I’d be afraid of naming conflicts. -
There some duplication I don’t like. The string
"$:/plugins/scott-sauyet/wizard-nav"
appears as the title of a tiddler, and also twice within the tiddler. Can a template tiddler somehow refer to its own title? This would be irrelevant if the answer to the previous question is no, and I should separate the tiddler name from the name users have to supply. -
This is my second attempt at a plugin. (The first ran into problems on Windows when I had no Windows machine to test with, and it was quickly abandoned.) Are there standards or common recommendations I’m ignoring in my ignorance? In other words, how would I make this more standard? (I know it’s technically not a plugin yet. I’ll figure that out later.)
And one I didn’t include there:
- Is this already done? Is there previous art – a built-in technique, a very similar plug-in, something else – that means that this was nothing more than an interesting learning exercise for me?
Edit And one more I just thought of:
-
Is there some convention for naming CSS classes to avoid potential conflicts? I have an element with the class
"wizard-nav"
. Should that be namespaced somehow?