Build-index-and-export question

61 views
Skip to first unread message

David Gifford

unread,
Dec 7, 2020, 3:49:57 PM12/7/20
to TiddlyWiki
The following snippet builds an index of tiddlers with one button, then exports the index with another button. But while I tried to limit the tiddlers in the index to include only those with the word `Topics` in the `meta` field, it is adding all the tiddlers to the index. Any advice?

\define indexvalue() $(title)$|$(caption)$|$(tags)$

<$wikify name=indextitle text={{{ [{$:/SiteTitle}addprefix[index-for-]] }}} >

<$button>Make Index
<$list filter="[!is[system]meta[Topics]]">
<$vars title={{!!title}} caption={{!!caption}} tags={{!!tags}} >
<$action-setfield $tiddler=<<indextitle>> $index=<<currentTiddler>> $value=<<indexvalue>>/>
</$vars>
</$list>
<$wikify name=tiddlywiki text={{{ [{$:/SiteTitle}addsuffix[.html]][{$:/config/SaveWikiButton/Filename}]+[!is[blank]last[]] }}} >
<$action-setfield $tiddler=<<indextitle>> $field="tiddlywiki" $value=<<tiddlywiki>>/>
<$action-setfield $tiddler=<<indextitle>> $field="index-source" $value="./XXXXX.sources.html"/>
</$wikify>
</$button>
<$vars tv-config-toolbar-class="tc-button tt-button">
<$list filter="[<indextitle>!is[missing]]">{{||$:/core/ui/Buttons/export-tiddler}}</$list>
</$vars>
</$wikify>

TW Tones

unread,
Dec 7, 2020, 9:28:38 PM12/7/20
to TiddlyWiki
David,

When you surprisingly get all tiddler listed it is often because of a fault in your filters. Check them in more detail.

A Quick look my self, I would fix this
text={{{ [{$:/SiteTitle}addsuffix[.html]][{$:/config/SaveWikiButton/Filename}]+[!is[blank]last[]] }}}  Yours
text={{{ [{$:/SiteTitle}addsuffix[.html]] [{$:/config/SaveWikiButton/Filename}] +[!is[blank]last[]] }}}  Mine

But I don't have the test data to check it further.
I always use spaces between runs, did you want 3 different runs?

Tones

David Gifford

unread,
Dec 7, 2020, 10:21:43 PM12/7/20
to tiddl...@googlegroups.com
Worked! Thank you, Tones!

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/m5JY955nNTM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/652770f0-91e8-4cdf-b183-582d15cd7df9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages