1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-25 09:30:28 +00:00

Migrate some old macros to new syntax (#8768)

* Migrate some old macros to new syntax

* Rewrite more macros.

* Update image-picker

* Rewrite tabs macro

* Use more new syntax

* Revert thumbnail macro

* Avoid duplicated whitespace pragma

* Revert tabs macro
This commit is contained in:
Leilei332 2024-12-05 20:40:13 +08:00 committed by GitHub
parent 673a0f5605
commit 2801eee905
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 102 additions and 115 deletions

View File

@ -1,58 +1,55 @@
title: $:/core/macros/colour-picker title: $:/core/macros/colour-picker
tags: $:/tags/Macro tags: $:/tags/Macro
\define colour-picker-update-recent() \procedure colour-picker-update-recent()
<$action-listops <$action-listops
$tiddler="$:/config/ColourPicker/Recent" $tiddler="$:/config/ColourPicker/Recent"
$subfilter="$(colour-picker-value)$ [list[$:/config/ColourPicker/Recent]remove[$(colour-picker-value)$]] +[limit[8]]" $subfilter="[<colour-picker-value>] [list[$:/config/ColourPicker/Recent]remove<colour-picker-value>] +[limit[8]]"
/> />
\end \end
\define colour-picker-inner(actions) \procedure colour-picker-inner(actions)
<$button tag="a" tooltip="""$(colour-picker-value)$"""> <$button tag="a" tooltip=<<colour-picker-value>>>
$(colour-picker-update-recent)$ <<colour-picker-update-recent>>
<$transclude $variable="__actions__"/> <$transclude $variable="actions"/>
<span style.display="inline-block" style.backgroundColor=<<colour-picker-value>> style.width="100%" style.height="100%" style.borderRadius="50%"/>
<span style="display:inline-block; background-color: $(colour-picker-value)$; width: 100%; height: 100%; border-radius: 50%;"/>
</$button> </$button>
\end \end
\define colour-picker-recent-inner(actions)
\whitespace trim \whitespace trim
<$set name="colour-picker-value" value="$(recentColour)$"> \procedure colour-picker-recent-inner(actions)
<$macrocall $name="colour-picker-inner" actions=<<__actions__>>/> <$set name="colour-picker-value" value=<<recentColour>>>
<$transclude $variable="colour-picker-inner" actions=<<actions>>/>
</$set> </$set>
\end \end
\define colour-picker-recent(actions) \procedure colour-picker-recent(actions)
\whitespace trim
{{$:/language/ColourPicker/Recent}}<$list filter="[list[$:/config/ColourPicker/Recent]]" variable="recentColour"> {{$:/language/ColourPicker/Recent}}<$list filter="[list[$:/config/ColourPicker/Recent]]" variable="recentColour">
&#32; &#32;
<$macrocall $name="colour-picker-recent-inner" actions=<<__actions__>>/> <$transclude $variable="colour-picker-recent-inner" actions=<<actions>>/>
</$list> </$list>
\end \end
\define colour-picker(actions) \procedure colour-picker(actions)
\whitespace trim
<div class="tc-colour-chooser"> <div class="tc-colour-chooser">
<$macrocall $name="colour-picker-recent" actions=<<__actions__>>/> <$transclude $variable="colour-picker-recent" actions=<<actions>>/>
--- ---
<$list filter="LightPink Pink Crimson LavenderBlush PaleVioletRed HotPink DeepPink MediumVioletRed Orchid Thistle Plum Violet Magenta Fuchsia DarkMagenta Purple MediumOrchid DarkViolet DarkOrchid Indigo BlueViolet MediumPurple MediumSlateBlue SlateBlue DarkSlateBlue Lavender GhostWhite Blue MediumBlue MidnightBlue DarkBlue Navy RoyalBlue CornflowerBlue LightSteelBlue LightSlateGrey SlateGrey DodgerBlue AliceBlue SteelBlue LightSkyBlue SkyBlue DeepSkyBlue LightBlue PowderBlue CadetBlue Azure LightCyan PaleTurquoise Cyan Aqua DarkTurquoise DarkSlateGrey DarkCyan Teal MediumTurquoise LightSeaGreen Turquoise Aquamarine MediumAquamarine MediumSpringGreen MintCream SpringGreen MediumSeaGreen SeaGreen Honeydew LightGreen PaleGreen DarkSeaGreen LimeGreen Lime ForestGreen Green DarkGreen Chartreuse LawnGreen GreenYellow DarkOliveGreen YellowGreen OliveDrab Beige LightGoldenrodYellow Ivory LightYellow Yellow Olive DarkKhaki LemonChiffon PaleGoldenrod Khaki Gold Cornsilk Goldenrod DarkGoldenrod FloralWhite OldLace Wheat Moccasin Orange PapayaWhip BlanchedAlmond NavajoWhite AntiqueWhite Tan BurlyWood Bisque DarkOrange Linen Peru PeachPuff SandyBrown Chocolate SaddleBrown Seashell Sienna LightSalmon Coral OrangeRed DarkSalmon Tomato MistyRose Salmon Snow LightCoral RosyBrown IndianRed Red Brown FireBrick DarkRed Maroon White WhiteSmoke Gainsboro LightGrey Silver DarkGrey Grey DimGrey Black" variable="colour-picker-value"> <$list filter="LightPink Pink Crimson LavenderBlush PaleVioletRed HotPink DeepPink MediumVioletRed Orchid Thistle Plum Violet Magenta Fuchsia DarkMagenta Purple MediumOrchid DarkViolet DarkOrchid Indigo BlueViolet MediumPurple MediumSlateBlue SlateBlue DarkSlateBlue Lavender GhostWhite Blue MediumBlue MidnightBlue DarkBlue Navy RoyalBlue CornflowerBlue LightSteelBlue LightSlateGrey SlateGrey DodgerBlue AliceBlue SteelBlue LightSkyBlue SkyBlue DeepSkyBlue LightBlue PowderBlue CadetBlue Azure LightCyan PaleTurquoise Cyan Aqua DarkTurquoise DarkSlateGrey DarkCyan Teal MediumTurquoise LightSeaGreen Turquoise Aquamarine MediumAquamarine MediumSpringGreen MintCream SpringGreen MediumSeaGreen SeaGreen Honeydew LightGreen PaleGreen DarkSeaGreen LimeGreen Lime ForestGreen Green DarkGreen Chartreuse LawnGreen GreenYellow DarkOliveGreen YellowGreen OliveDrab Beige LightGoldenrodYellow Ivory LightYellow Yellow Olive DarkKhaki LemonChiffon PaleGoldenrod Khaki Gold Cornsilk Goldenrod DarkGoldenrod FloralWhite OldLace Wheat Moccasin Orange PapayaWhip BlanchedAlmond NavajoWhite AntiqueWhite Tan BurlyWood Bisque DarkOrange Linen Peru PeachPuff SandyBrown Chocolate SaddleBrown Seashell Sienna LightSalmon Coral OrangeRed DarkSalmon Tomato MistyRose Salmon Snow LightCoral RosyBrown IndianRed Red Brown FireBrick DarkRed Maroon White WhiteSmoke Gainsboro LightGrey Silver DarkGrey Grey DimGrey Black" variable="colour-picker-value">
&#32; &#32;
<$macrocall $name="colour-picker-inner" actions=<<__actions__>>/> <$transclude $variable="colour-picker-inner" actions=<<actions>>/>
</$list> </$list>
--- ---
<$edit-text tiddler="$:/config/ColourPicker/New" tag="input" default="" placeholder=""/> <$edit-text tiddler="$:/config/ColourPicker/New" tag="input" default="" placeholder="" class="tc-tiny-gap-right"/>
&#32;
<$edit-text tiddler="$:/config/ColourPicker/New" type="color" tag="input"/> <$edit-text tiddler="$:/config/ColourPicker/New" type="color" tag="input"/>
<$set name="colour-picker-value" value={{$:/config/ColourPicker/New}}> <$set name="colour-picker-value" value={{$:/config/ColourPicker/New}}>
<$macrocall $name="colour-picker-inner" actions=<<__actions__>>/> <%if [{$:/config/ColourPicker/New}!is[blank]] %>
<$transclude $variable="colour-picker-inner" actions=<<actions>>/>
<%endif%>
</$set> </$set>
</div> </div>

View File

@ -1,7 +1,7 @@
title: $:/core/macros/dumpvariables title: $:/core/macros/dumpvariables
tags: $:/tags/Macro tags: $:/tags/Macro
\define dumpvariables() \procedure dumpvariables()
\whitespace trim \whitespace trim
<ul> <ul>
<$list filter="[variables[]]" variable="varname"> <$list filter="[variables[]]" variable="varname">

View File

@ -1,39 +1,36 @@
created: 20170715180840889
modified: 20170715180914005
tags: $:/tags/Macro tags: $:/tags/Macro
title: $:/core/macros/image-picker title: $:/core/macros/image-picker
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
\define image-picker-thumbnail(actions) \procedure image-picker-thumbnail(actions)
<$button tag="a" tooltip="""$(imageTitle)$"""><$transclude $variable="__actions__"/><$transclude tiddler=<<imageTitle>>/></$button> <$button tag="a" tooltip=<<imageTitle>>><$transclude $variable="actions"/><$transclude tiddler=<<imageTitle>>/></$button>
\end \end
\define image-picker-list(filter,actions) \procedure image-picker-list(filter,actions)
\whitespace trim \whitespace trim
<$list filter="""$filter$""" variable="imageTitle"> <$list filter=<<filter>> variable="imageTitle">
<$macrocall $name="image-picker-thumbnail" actions=<<__actions__>>/> <$transclude $variable="image-picker-thumbnail" actions=<<actions>>/>
&#32; &#32;
</$list> </$list>
\end \end
\define image-picker(actions,filter:"[all[shadows+tiddlers]is[image]] -[type[application/pdf]] +[!has[draft.of]$subfilter$sort[title]]",subfilter:"") \procedure image-picker(actions,filter:"[all[shadows+tiddlers]is[image]] -[type[application/pdf]] +[!has[draft.of]$subfilter$sort[title]]",subfilter:"")
\whitespace trim \whitespace trim
<div class="tc-image-chooser"> <div class="tc-image-chooser">
<$vars state-system=<<qualify "$:/state/image-picker/system">>> <$let state-system=<<qualify "$:/state/image-picker/system">> tv-filter={{{ [<filter>search-replace[$subfilter$],<subfilter>] }}}>
<$checkbox tiddler=<<state-system>> field="text" checked="show" unchecked="hide" default="hide"> <$checkbox tiddler=<<state-system>> field="text" checked="show" unchecked="hide" default="hide">
&#32; <span class="tc-tiny-gap-left">{{$:/language/SystemTiddlers/Include/Prompt}}</span>
{{$:/language/SystemTiddlers/Include/Prompt}}
</$checkbox> </$checkbox>
<$reveal state=<<state-system>> type="match" text="hide" default="hide" tag="div"> <$reveal state=<<state-system>> type="match" text="hide" default="hide" tag="div">
<$macrocall $name="image-picker-list" filter="""$filter$ +[!is[system]]""" actions=<<__actions__>>/> <$transclude $variable="image-picker-list" filter=`$(tv-filter)$ +[!is[system]]` actions=<<actions>>/>
</$reveal> </$reveal>
<$reveal state=<<state-system>> type="nomatch" text="hide" default="hide" tag="div"> <$reveal state=<<state-system>> type="nomatch" text="hide" default="hide" tag="div">
<$macrocall $name="image-picker-list" filter="""$filter$""" actions=<<__actions__>>/> <$transclude $variable="image-picker-list" filter=<<tv-filter>> actions=<<actions>>/>
</$reveal> </$reveal>
</$vars> </$let>
</div> </div>
\end \end
\define image-picker-include-tagged-images(actions) \procedure image-picker-include-tagged-images(actions)
<$macrocall $name="image-picker" filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]" actions=<<__actions__>>/> <$transclude $variable="image-picker" filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]" actions=<<actions>>/>
\end \end

View File

@ -1,14 +1,18 @@
title: $:/core/macros/list title: $:/core/macros/list
tags: $:/tags/Macro tags: $:/tags/Macro
\define list-links(filter,type:"ul",subtype:"li",class:"",emptyMessage,field:"caption") \procedure list-links-draggable-drop-actions()
<$action-listops $tiddler=<<targetTiddler>> $field=<<targetField>> $subfilter="+[insertbefore<actionTiddler>,<currentTiddler>]"/>
\end
\whitespace trim \whitespace trim
<$genesis $type=<<__type__>> class=<<__class__>>> \procedure list-links(filter,type:"ul",subtype:"li",class:"",emptyMessage,field:"caption")
<$list filter=<<__filter__>> emptyMessage=<<__emptyMessage__>>> <$genesis $type=<<type>> class=<<class>>>
<$genesis $type=<<__subtype__>>> <$list filter=<<filter>> emptyMessage=<<emptyMessage>>>
<$genesis $type=<<subtype>>>
<$link to={{!!title}}> <$link to={{!!title}}>
<$let tv-wikilinks="no"> <$let tv-wikilinks="no">
<$transclude field=<<__field__>>> <$transclude field=<<field>>>
<$view field="title"/> <$view field="title"/>
</$transclude> </$transclude>
</$let> </$let>
@ -18,24 +22,19 @@ tags: $:/tags/Macro
</$genesis> </$genesis>
\end \end
\define list-links-draggable-drop-actions() \procedure list-links-draggable(tiddler,field:"list",emptyMessage,type:"ul",subtype:"li",class:"",itemTemplate)
<$action-listops $tiddler=<<targetTiddler>> $field=<<targetField>> $subfilter="+[insertbefore<actionTiddler>,<currentTiddler>]"/>
\end
\define list-links-draggable(tiddler,field:"list",emptyMessage,type:"ul",subtype:"li",class:"",itemTemplate)
\whitespace trim
<span class="tc-links-draggable-list"> <span class="tc-links-draggable-list">
<$vars targetTiddler="""$tiddler$""" targetField="""$field$"""> <$let targetTiddler=<<tiddler>> targetField=<<field>>>
<$genesis $type=<<__type__>> class="$class$"> <$genesis $type=<<type>> class=<<class>>>
<$list filter="[list[$tiddler$!!$field$]]" emptyMessage=<<__emptyMessage__>>> <$list filter="[<tiddler>get<field>enlist-input[]]" emptyMessage=<<emptyMessage>>>
<$droppable <$droppable
actions=<<list-links-draggable-drop-actions>> actions=<<list-links-draggable-drop-actions>>
tag="""$subtype$""" tag=<<subtype>>
enable=<<tv-enable-drag-and-drop>> enable=<<tv-enable-drag-and-drop>>
> >
<div class="tc-droppable-placeholder"/> <div class="tc-droppable-placeholder"/>
<div> <div>
<$transclude tiddler="""$itemTemplate$"""> <$transclude tiddler=<<itemTemplate>>>
<$link to={{!!title}}> <$link to={{!!title}}>
<$let tv-wikilinks="no"> <$let tv-wikilinks="no">
<$transclude field="caption"> <$transclude field="caption">
@ -60,50 +59,48 @@ tags: $:/tags/Macro
</$droppable> </$droppable>
</$tiddler> </$tiddler>
</$genesis> </$genesis>
</$vars> </$let>
</span> </span>
\end \end
\define list-tagged-draggable-drop-actions(tag) \procedure list-tagged-draggable-drop-actions(tag)
\whitespace trim
<!-- Save the current ordering of the tiddlers with this tag --> <!-- Save the current ordering of the tiddlers with this tag -->
<$set name="order" filter="[<__tag__>tagging[]]"> <$set name="order" filter="[<tag>tagging[]]">
<!-- Remove any list-after or list-before fields from the tiddlers with this tag --> <!-- Remove any list-after or list-before fields from the tiddlers with this tag -->
<$list filter="[<__tag__>tagging[]]"> <$list filter="[<tag>tagging[]]">
<$action-deletefield $field="list-before"/> <$action-deletefield $field="list-before"/>
<$action-deletefield $field="list-after"/> <$action-deletefield $field="list-after"/>
</$list> </$list>
<!-- Save the new order to the Tag Tiddler --> <!-- Save the new order to the Tag Tiddler -->
<$action-listops $tiddler=<<__tag__>> $field="list" $filter="+[enlist<order>] +[insertbefore<actionTiddler>,<currentTiddler>]"/> <$action-listops $tiddler=<<tag>> $field="list" $filter="+[enlist<order>] +[insertbefore<actionTiddler>,<currentTiddler>]"/>
<!-- Make sure the newly added item has the right tag --> <!-- Make sure the newly added item has the right tag -->
<!-- Removing this line makes dragging tags within the dropdown work as intended --> <!-- Removing this line makes dragging tags within the dropdown work as intended -->
<!--<$action-listops $tiddler=<<actionTiddler>> $tags=<<__tag__>>/>--> <!--<$action-listops $tiddler=<<actionTiddler>> $tags=<<tag>>/>-->
<!-- Using the following 5 lines as replacement makes dragging titles from outside into the dropdown apply the tag --> <!-- Using the following 5 lines as replacement makes dragging titles from outside into the dropdown apply the tag -->
<$list filter="[<actionTiddler>!contains:tags<__tag__>]"> <$list filter="[<actionTiddler>!contains:tags<tag>]">
<$fieldmangler tiddler=<<actionTiddler>>> <$fieldmangler tiddler=<<actionTiddler>>>
<$action-sendmessage $message="tm-add-tag" $param=<<__tag__>>/> <$action-sendmessage $message="tm-add-tag" $param=<<tag>>/>
</$fieldmangler> </$fieldmangler>
</$list> </$list>
</$set> </$set>
\end \end
\define list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div",storyview:"") \procedure list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div",storyview:"")
\whitespace trim
<span class="tc-tagged-draggable-list"> <span class="tc-tagged-draggable-list">
<$set name="tag" value=<<__tag__>>> <$set name="tag" value=<<tag>>>
<$list <$list
filter="[<__tag__>tagging[]$subFilter$]" filter=`[<tag>tagging[]$(subFilter)$]`
emptyMessage=<<__emptyMessage__>> emptyMessage=<<emptyMessage>>
storyview=<<__storyview__>> storyview=<<storyview>>
> >
<$genesis $type=<<__elementTag__>> class="tc-menu-list-item"> <$genesis $type=<<elementTag>> class="tc-menu-list-item">
<$droppable <$droppable
actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""" actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<tag>>/>"""
enable=<<tv-enable-drag-and-drop>> enable=<<tv-enable-drag-and-drop>>
> >
<$genesis $type=<<__elementTag__>> class="tc-droppable-placeholder"/> <$genesis $type=<<elementTag>> class="tc-droppable-placeholder"/>
<$genesis $type=<<__elementTag__>>> <$genesis $type=<<elementTag>>>
<$transclude tiddler="""$itemTemplate$"""> <$transclude tiddler=<<itemTemplate>>>
<$link to={{!!title}}> <$link to={{!!title}}>
<$view field="title"/> <$view field="title"/>
</$link> </$link>
@ -114,11 +111,11 @@ tags: $:/tags/Macro
</$list> </$list>
<$tiddler tiddler=""> <$tiddler tiddler="">
<$droppable <$droppable
actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""" actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<tag>>/>"""
enable=<<tv-enable-drag-and-drop>> enable=<<tv-enable-drag-and-drop>>
> >
<$genesis $type=<<__elementTag__>> class="tc-droppable-placeholder"/> <$genesis $type=<<elementTag>> class="tc-droppable-placeholder"/>
<$genesis $type=<<__elementTag__>> style="height:0.5em;"/> <$genesis $type=<<elementTag>> style="height:0.5em;"/>
</$droppable> </$droppable>
</$tiddler> </$tiddler>
</$set> </$set>

View File

@ -1,28 +1,28 @@
title: $:/core/macros/translink title: $:/core/macros/translink
tags: $:/tags/Macro tags: $:/tags/Macro
\define translink(title,mode:"block") \procedure translink(title,mode:"block")
\whitespace trim \whitespace trim
<$list filter="[<__mode__>match[block]]"> <%if [<mode>match[block]] %>
<div class="tc-translink"> <div class="tc-translink">
<div> <div>
<$link to="""$title$"""> <$link to=<<title>>>
<h1><$text text="""$title$"""/></h1> <h1><$text text=<<title>>/></h1>
</$link> </$link>
<$transclude tiddler="""$title$""" mode="block"> <$transclude tiddler=<<title>> mode="block">
<$set name="currentTiddler" value="""$title$"""><$transclude tiddler="$:/language/MissingTiddler/Hint"/></$set> <$set name="currentTiddler" value=<<title>>><$transclude tiddler="$:/language/MissingTiddler/Hint"/></$set>
</$transclude> </$transclude>
</div> </div>
</div> </div>
</$list> <%endif%>
<$list filter="[<__mode__>match[inline]]"> <%if [<mode>match[inline]] %>
<span class="tc-translink"> <span class="tc-translink">
<$link to="""$title$"""> <$link to=<<title>> class="tc-tiny-gap-right">
<$text text="""$title$"""/> <$text text=<<title>>/>
</$link> </$link>
&#32;(<$transclude tiddler="""$title$""" mode="inline"> (<$transclude tiddler=<<title>> mode="inline">
<$set name="currentTiddler" value="""$title$"""><$transclude tiddler="$:/language/MissingTiddler/Hint"/></$set> <$set name="currentTiddler" value=<<title>>><$transclude tiddler="$:/language/MissingTiddler/Hint"/></$set>
</$transclude>) </$transclude>)
</span> </span>
</$list> <%endif%>
\end \end

View File

@ -1,62 +1,58 @@
title: $:/core/macros/tree title: $:/core/macros/tree
tags: $:/tags/Macro tags: $:/tags/Macro
\define leaf-link(full-title,chunk,separator: "/") \procedure leaf-link(full-title,chunk,separator: "/")
<$link to=<<__full-title__>>><$text text=<<__chunk__>>/></$link> <$link to=<<full-title>>><$text text=<<chunk>>/></$link>
\end \end
\define leaf-node(prefix,chunk)
\whitespace trim \whitespace trim
\procedure leaf-node(prefix,chunk)
<li> <li>
<$list filter="[<__prefix__>addsuffix<__chunk__>is[shadow]] [<__prefix__>addsuffix<__chunk__>is[tiddler]]" variable="full-title"> <$list filter="[<prefix>addsuffix<chunk>is[shadow]] [<prefix>addsuffix<chunk>is[tiddler]]" variable="full-title">
<$list filter="[<full-title>removeprefix<__prefix__>]" variable="chunk"> <$list filter="[<full-title>removeprefix<prefix>]" variable="chunk">
<span>{{$:/core/images/file}}</span>&#32;<$macrocall $name="leaf-link" full-title=<<full-title>> chunk=<<chunk>>/> <span class="tc-tiny-gap-right">{{$:/core/images/file}}</span><$transclude $variable="leaf-link" full-title=<<full-title>> chunk=<<chunk>>/>
</$list> </$list>
</$list> </$list>
</li> </li>
\end \end
\define branch-node(prefix,chunk,separator: "/") \procedure branch-node(prefix,chunk,separator: "/")
\whitespace trim
<li> <li>
<$set name="reveal-state" value={{{ [[$:/state/tree/]addsuffix<__prefix__>addsuffix<__chunk__>] }}}> <$set name="reveal-state" value={{{ [[$:/state/tree/]addsuffix<prefix>addsuffix<chunk>] }}}>
<$reveal type="nomatch" stateTitle=<<reveal-state>> text="show"> <$reveal type="nomatch" stateTitle=<<reveal-state>> text="show">
<$button setTitle=<<reveal-state>> setTo="show" class="tc-btn-invisible"> <$button setTitle=<<reveal-state>> setTo="show" class="tc-btn-invisible">
{{$:/core/images/folder}}&#32;<$text text=<<__chunk__>>/> {{$:/core/images/folder}}&#32;<$text text=<<chunk>>/>
</$button> </$button>
</$reveal> </$reveal>
<$reveal type="match" stateTitle=<<reveal-state>> text="show"> <$reveal type="match" stateTitle=<<reveal-state>> text="show">
<$button setTitle=<<reveal-state>> setTo="hide" class="tc-btn-invisible"> <$button setTitle=<<reveal-state>> setTo="hide" class="tc-btn-invisible">
{{$:/core/images/folder}}&#32;<$text text=<<__chunk__>>/> {{$:/core/images/folder}}&#32;<$text text=<<chunk>>/>
</$button> </$button>
</$reveal> </$reveal>
&#32; <span class="tc-tiny-gap-left">(<$count filter="[all[shadows+tiddlers]removeprefix<prefix>removeprefix<chunk>] -[<prefix>addsuffix<chunk>]"/>)</span>
<span>(<$count filter="[all[shadows+tiddlers]removeprefix<__prefix__>removeprefix<__chunk__>] -[<__prefix__>addsuffix<__chunk__>]"/>)</span>
<$reveal type="match" stateTitle=<<reveal-state>> text="show"> <$reveal type="match" stateTitle=<<reveal-state>> text="show">
<$macrocall $name="tree-node" prefix={{{ [<__prefix__>addsuffix<__chunk__>] }}} separator=<<__separator__>>/> <$transclude $variable="tree-node" prefix={{{ [<prefix>addsuffix<chunk>] }}} separator=<<separator>>/>
</$reveal> </$reveal>
</$set> </$set>
</li> </li>
\end \end
\define tree-node(prefix,separator: "/") \procedure tree-node(prefix,separator: "/")
\whitespace trim
<ol> <ol>
<$list filter="[all[shadows+tiddlers]removeprefix<__prefix__>splitbefore<__separator__>sort[]!suffix<__separator__>]" variable="chunk"> <$list filter="[all[shadows+tiddlers]removeprefix<prefix>splitbefore<separator>sort[]!suffix<separator>]" variable="chunk">
<$macrocall $name="leaf-node" prefix=<<__prefix__>> chunk=<<chunk>> separator=<<__separator__>>/> <$transclude $variable="leaf-node" prefix=<<prefix>> chunk=<<chunk>> separator=<<separator>>/>
</$list> </$list>
<$list filter="[all[shadows+tiddlers]removeprefix<__prefix__>splitbefore<__separator__>sort[]suffix<__separator__>]" variable="chunk"> <$list filter="[all[shadows+tiddlers]removeprefix<prefix>splitbefore<separator>sort[]suffix<separator>]" variable="chunk">
<$macrocall $name="branch-node" prefix=<<__prefix__>> chunk=<<chunk>> separator=<<__separator__>>/> <$transclude $variable="branch-node" prefix=<<prefix>> chunk=<<chunk>> separator=<<separator>>/>
</$list> </$list>
</ol> </ol>
\end \end
\define tree(prefix: "$:/",separator: "/") \procedure tree(prefix: "$:/",separator: "/")
\whitespace trim
<div class="tc-tree"> <div class="tc-tree">
<span><$text text=<<__prefix__>>/></span> <span><$text text=<<prefix>>/></span>
<div> <div>
<$macrocall $name="tree-node" prefix=<<__prefix__>> separator=<<__separator__>>/> <$transclude $variable="tree-node" prefix=<<prefix>> separator=<<separator>>/>
</div> </div>
</div> </div>
\end \end