1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-13 03:30:27 +00:00

allow toc-filter fields to created open/close chevrons

This commit is contained in:
pmario 2024-02-08 14:44:34 +01:00
parent 6e23d8db51
commit 291e3a42b5

View File

@ -124,14 +124,18 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter
\procedure toc-tagChildFilter() [tag<currentTiddler>] \procedure toc-tagChildFilter() [tag<currentTiddler>]
<!-- this function uses the variables NOT the tiddler fields --> <!-- this function uses the variables NOT the tiddler fields -->
\function tf.toc-hasChildren() [<tagField>!is[blank]then<toc-tagLikeChildFilter>] :else[<parentField>!is[blank]then<toc-parentChildFilter>else<toc-tagChildFilter>] \function tf.toc-hasChildren()
[<tagField>!is[blank]then<toc-tagLikeChildFilter>]
:else[<parentField>!is[blank]then<toc-parentChildFilter>else<toc-tagChildFilter>]
\end
\procedure toc-openBranch(path,currentTiddler,manual:"no") \procedure toc-openBranch(path,currentTiddler,manual:"no")
\procedure recursiveOpen(exclude, path) \procedure recursiveOpen(exclude, path)
<!-- tf-toc-stateTitle needs the path variable! --> <!-- tf-toc-stateTitle needs the path variable! -->
<$let path={{{ [<path>] "/" [<currentTiddler>] +[join[]] }}}> <$let path={{{ [<path>] "/" [<currentTiddler>] +[join[]] }}}>
<!-- It's common that users tag the <currentTiddler> with itself, so avoid redundant state tiddlers with -[<currentTiddler>] -->
<$list filter="[subfilter<tf.toc-hasChildren>] [subfilter<tf.toc-curTidInclude>] -[<currentTiddler>] -[subfilter<exclude>]" > <$list filter="[subfilter<tf.toc-hasChildren>] [subfilter<tf.toc-curTidInclude>] -[<currentTiddler>] -[subfilter<exclude>]" >
<% if [subfilter<tf.toc-hasChildren>] %> <% if [subfilter<tf.toc-hasChildren>] [subfilter<tf.toc-curTidInclude>] -[<currentTiddler>] -[subfilter<exclude>] %>
<$set name="_excluded" filter="[subfilter<exclude>] [<currentTiddler>]"> <$set name="_excluded" filter="[subfilter<exclude>] [<currentTiddler>]">
<!-- tf-toc-stateTitle needs the path variable! --> <!-- tf-toc-stateTitle needs the path variable! -->
<$qualify name="toc-state" title=<<tf.toc-stateTitle>> > <$qualify name="toc-state" title=<<tf.toc-stateTitle>> >
@ -261,7 +265,7 @@ Shows an expandable toc. Item always have an open/close chevron
</$set> </$set>
\end \end
\function tf.toc-curTidInclude() [<currentTiddler>get<toc-includeField>] \function tf.toc-curTidInclude() [<currentTiddler>get<toc-includeField>] [<currentTiddler>get<toc-filterField>]
\procedure toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path,captionField,tagField,parentField,itemTemplate) \procedure toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path,captionField,tagField,parentField,itemTemplate)
<$qualify name="toc-state" title=<<tf.toc-stateTitle>>> <$qualify name="toc-state" title=<<tf.toc-stateTitle>>>