我刚刚找到了一个很棒的 TagCloud 生成工具 - https://tiddlytools.com/filtergenerators.html#TiddlyTools%2FFilterGenerators%2FTagCloud
您能否帮我更改仅显示特定标签的代码(例如:仅显示“TiddlyTools”和“$:/tags/ControlPanel”而没有其他标签)?
\define config() $:/config/TiddlyTools/TagCloud
\define tag-pill-styles() ---------- copied from $:/core/macros/tag - use $(count)$ to set font-size
\define tag-pill-styles()
background-color:$(backgroundColor)$;
fill:$(foregroundColor)$;
color:$(foregroundColor)$;
font-size:calc(0.5em + (0.2em * ($(count)$ / 5) ) );
\end
\define tag-pill-inner() ---------- copied from $:/core/macros/tag - added $(count)$ display in pill
\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
<$vars foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">> backgroundColor="""$colour$""">
<$element-tag$ $element-attributes$ class="tc-tag-label tc-btn-invisible" style=<<tag-pill-styles>>>
$actions$<$transclude tiddler="""$icon$"""/> <$view tiddler=<<__tag__>> field="title" format="text" /> ($(count)$)
</$element-tag$>
</$vars>
\end
\define tagcloud_get()
<$list filter="[all[tiddlers+shadows]tags[]]">
<$text text="[["/>{{{ [<currentTiddler>tagging[]count[]divide[10000]] }}};<<currentTiddler>><$text text="]]"/>
</$list>
\end
\define tagcloud_sort()
<$list filter="[enlist<items>!nsort[]]">
<$list filter="[<currentTiddler>split[;]last[]]"><$text text="[["/><<currentTiddler>><$text text="]]"/></$list>
</$list>
\end
\define tagcloud_showbycount()
<$wikify name="items" text=<<tagcloud_get>> >
<$wikify name="sorted" text=<<tagcloud_sort>> >
<$list filter=<<sorted>>>
<$vars count={{{ [<currentTiddler>tagging[]count[]] }}}>
<<tag>>
</$vars>
</$list>
</$wikify>
</$wikify>
\end
\define tagcloud_showbyname()
<$list filter="[all[tiddlers+shadows]tags[]sort[]]">
<$vars count={{{ [<currentTiddler>tagging[]count[]] }}}>
<<tag>>
</$vars>
</$list>
\end
<style> .tt-tagcloud input { width:auto !important; } </style>
<div class="tt-tagcloud">
There are ''<$text text={{{ [all[tiddlers+shadows]tags[]count[]]" }}}/> tags''
and a total of ''<$text text={{{ [all[tiddlers+shadows]tags[]tagging[]count[]]" }}}/>
tagged tiddlers''<br>
sort by:
<$radio tiddler=<<config>> field="sortorder" value="count"> tagging count </$radio>
<$radio tiddler=<<config>> field="sortorder" value="name"> tag name </$radio>
<p>
<$reveal default={{{ [<config>get[sortorder]] ~[[count]] }}} type="match" text="count"> <<tagcloud_showbycount>> </$reveal>
<$reveal default={{{ [<config>get[sortorder]] }}} type="match" text="name"> <<tagcloud_showbyname>> </$reveal>
</p>