\define numTids()<$list filter=<<tags>> variable="tagName"><$count filter="[tag<tagName>]" />_._._<<tagName>></$list>\end
\define listTags(tags)<$vars tags=<<__tags__>> ><$wikify name="mylist" text=<<numTids>> ><$list filter="[enlist<mylist>!sortan[]]" variable="item"><$list filter="[<item>splitbefore[_._._]removesuffix[_._._]]" variable="number"><$list filter="[<item>removeprefix<number>removeprefix[_._._]]" variable="name"><<name>> <<number>><br></$list></$list></$list></$wikify></$vars>\end
<<listTags "x y">>
y 4
x 3
I did not test it for strange tag names like this "my Crazy! [tag+?]]"
_._._Thanks for this. That is a process heavy construct and I was/am kind of hoping for something much more direct. I have some vague feeling a subfilter operator might be involved but can't put my finger on it.
The new TW 5.1.20 indexed tag list should have the numbers "for free", the second time you want to know it. ... So a construction like [tag[xx]count[]] should be much much faster than with 5.1.19. except for the first [tag[xx]] run.
\define expr() ^$(counts2)$$
\define listTags(tags)
<$wikify name="counts" text=<<tagcount "$tags$">>>
<$list filter="[enlist<counts>nsort[]]" variable="counts2">
<$list filter="[enlist<__tags__>sort[]]" variable="tag">
<$list filter="[tag<tag>count[]regexp<expr>]">
<<counts2>> -- <<tag>> <br/>
</$list>
</$list>
</$list>
</$wikify>
\end
\define tagcount(tags)
<$list filter="[enlist<__tags__>]" variable="tag">
<$list filter="[tag<tag>count[]]"/>
</$list>
\end
<<listTags "TableOfContents About Articles">>--Mohammad
I was working on writing each tagname as a key in a data tiddler with the value equal to the count. All good till then but I stopped running down that rabbit hole trying to list the keys ordered by there value.
I think we need the ability to write to a multi column array then manipulate it in the next step without needing triggers or buttons.
With 5.1.20 maths operators I have realised tiddlywiki does not have parenthesis to control the order of evaluation and this along with variables we can manipulate across widgets would give us the capacity to write more elegant solutions.
Regards
Tony
<$wikify name="mylist" text=<<numTids>> > the macro assign the same value: 4_._._x 3_._._y to mylist variable but the code does not run. I can't understand why.
I don't understand what is the function of the wikify widget not even reading the documentation.
I think I understand the rest of the macro.
Thanks.