Listing tiddlers sorted by size - table view

Just another suggestion that could help. I’ve noticed with my own TiddlyWikis that large individual tiddlers can really slow the entire wiki. I had created some graphic image tiddlers by drag & drop, rather than an external reference. And my system was exceedingly slow. I write this little script to short all my tiddlers by file size (largest first). Once removing (redoing) a few of those tiddlers, my wiki was lightening fast!


<table><tr><th>title</th><th>size</th></tr>
<$list filter="[all[tiddlers]] :sort:integer:reverse[<currentTiddler>get[text]length[]]">
   <tr>
      <td><$link/></td>
      <td style="text-align:right;"><$text text={{{ [<currentTiddler>get[text]length[]] }}}/></td>
   </tr>
</$list>
</table>

2 Likes

Mark, that’s a fantastic script. I’ve been waiting for something like that! It should be standard in the core of upcoming releases.
filter="[all[tiddlers]!is[system]]"

1 Like

Here’s a script for the revers (small to large):


<table><tr><th>title</th><th>size</th></tr>
<$list filter="[all[tiddlers]] :sort:integer[<currentTiddler>get[text]length[]]">
   <tr>
      <td><$link/></td>
      <td style="text-align:right;"><$text text={{{ [<currentTiddler>get[text]length[]] }}}/></td>
   </tr>
</$list>
</table>

You might be interested in my TiddlyTools “PowerSearch” tool: TiddlyTools/Search/Filters

It lets you enter any filter (or select from previously saved filters)
and then displays a list of matching tiddlers, which can be sorted by title, size, modified date or created date. You can also perform a “secondary” filter to further reduce the resulting list by entering text (or a regexp pattern) and selecting one or more fields to match against.

Thus, you could filter for [all[tiddlers]is[image]!has[_canonical_uri]], sorted by size (largest to smallest) for which the type field contains “jpeg”.

You can then perform various actions on the resulting list:

  • add/remove tag(s)
  • clone tiddlers
  • export tiddlers
  • delete tiddlers

enjoy,
-e