When I read something, and I throw it into the wiki, I have a tendency to
chunk it into smaller examples...
When I do this I use the "Excise" functionality to split the long text out;
it works great but...when I want to split it into tabs the tabs show up
with their full titles, and I'd prefer if I didn't have to go to every
single tiddler and add a caption, tooltip and order for ever single one; so
in looking into this I wrote the following macro so that they are
<$button>
<!-- 1. The title of the current tiddler is obtained into the
whichTiddlerTag variable
at this level that is what you get (unless of course you are in
draft mode...in which case,
I guess you could use !!draft.of instead? )
-->
<$set name="whichTiddlerTag" value=<<currentTiddler>> >
<!-- 2. Obtain a count of how many tiddlers have been Excised / tagged with
this tiddler's title -->
<$list filter="[tag<whichTiddlerTag>count[]]">
<!-- 3. A range is generated from 1 to number of excised tiddlers which is
now occupying the currentTiddler variable.-->
<$list filter="[range<currentTiddler>]">
<!-- 4. For each item in the range from 1 to number of excised tiddlers
obtain the tiddler name into whichTiddler based on currentTiddler's
1,2,3,4... -->
<$set name="whichTiddler" filter="[tag<whichTiddlerTag>]" select=<
<currentTiddler>> >
<!-- 5. whichTiddler contains the name of an individual excised tiddler and
currentTiddler is the number in the list. -->
<$action-setfield $tiddler=<<whichTiddler>> $field="caption"
$value=<<currentTiddler>> />
<$action-setfield $tiddler=<<whichTiddler>> $field="tooltip"
$value=<<whichTiddler>> />
<$action-setfield $tiddler=<<whichTiddler>> $field="order"
$value=<<currentTiddler>> />
</$set>
</$list>
</$list>
</$set>
Set Tab Order, Tooltips and Captions
</$button>
<!-- Displays tabs when we are in draft mode -->
<<tabs "[tag{!!title}]">>
<!-- Displays tabs when we are in view mode -->
<<tabs "[tag{!!draft.of}]">>
The script sort of works...not exactly...the first tiddler is always
skipped, I'm assuming because the select attribute of $set under 4. wants
to start with 0 instead of 1.
But anyway making this work would save massive amounts of time in wikiing,
any suggestions on how to make this work?
Also the currentTiddler variable and how it changes makes the code almost
unreadable!
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/b8e31b96-2fee-4f98-9498-85c2f5670a77%40googlegroups.com.