On Wednesday, July 1, 2020 at 5:52:07 PM UTC-7, TW Tones wrote:
>
> \define title-string() "title": "
> \define end-title() "
> <$list filter=
> "[{$:/HistoryList}split<title-string>splitbefore<end-title>removesuffix<end-title>reverse[]]"
> >
> <$text text=<<currentTiddler>>/><br>
> </$list>
> Now a little more work to remove tiddlers that no longer exist from the
> list.
>
Just add is[tiddler] to the end of your filter:
<$list filter="[{$:/HistoryList}split<title-string>splitbefore<end-title>
removesuffix<end-title>reverse[]is[tiddler]]">
Also, you should note that the $:/HistoryList doesn't exist until you've
actually navigated to a tiddler.
Thus, when you first load a document, if there are any tiddlers opened by
$:/DefaultTiddlers, you
will want to add those to your generated list of titles by adding the
contents of $:/StoryList!!list
...and, since *closing* tiddlers doesn't affect the $:/HistoryList, if you
close the initial tiddlers
immediately after loading the document, there still won't be anything in
the history, even though
default tiddlers were displayed. Thus, you will also want to explicitly
add the contents of
$:/DefaultTiddlers to the list, so that they will always be included in the
result.
Here's the filter that I've used in my own "History" interface at
http://TiddlyTools.com/InsideTW:
\define history() [{$:/HistoryList}split["title": "]splitbefore["]
removesuffix["]reverse[]is[tiddler]] [enlist{$:/StoryList!!list}]
[enlist{$:/DefaultTiddlers}]
enjoy,
-e
--
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/a5fa322c-f93a-4bdc-822a-d1e090d11bb4o%40googlegroups.com.