Missing tiddlers by number of references?

Skip to first unread message

Linda Moss

Oct 30, 2018, 1:04:55 AM10/30/18
to TiddlyWiki
Is there a way I can list all missing tiddlers, that shows a count of how many references there are to the missing tiddler, and sort the list by the count descending? (even better if I can give it a cut-off, such as not listing missing tiddlers with only a single reference).

I've got a 12-megabyte tiddly-wiki in which I've frequently included links to things that don't exist yet but that I plan to add. (Also, I make a lot of typos). As a result, my "missing tiddlers" list is currently far too long to be useful. When doing wiki maintenance, I'd love to be able to focus on the most-referenced missing tiddlers. Is this possible?


Rob Hoelz

Oct 30, 2018, 11:18:50 AM10/30/18
to TiddlyWiki
Hi Linda,

You might find the "[all[missing]]" filter useful for this, combined with "+[backlinks[]]" to get the tiddlers linking to each missing tiddler.  There might be a smarter way to filter out missing tiddlers with only one reference, but I would probably use "[butfirst[]]" to find tiddlers with more than one reference.  As far as sorting by count goes, I don't have any ideas, but maybe http://tobibeer.github.io/tw5-plugins/#filter would be helpful!


Mark S.

Oct 30, 2018, 12:49:39 PM10/30/18
to TiddlyWiki

Here we go -- a Halloween themed code for finding "spooky" links:

\define chimera-counts-filter() $(boo)$ +[nsort[]] +[!prefix[1-]]
\define scares-ghost() [[$(scares)$-$(ghost)$]]
\define chimera-counts()
<$list filter="[all[tiddlers]links[]is[missing]!is[system]]" variable="ghost">
<$list filter="[<ghost>backlinks[]count[]]" variable="scares" >
<$text text=<<scares-ghost>>/>

<$wikify name="boo" text=<<chimera-counts>>>
<$list filter=<<chimera-counts-filter>>>


The results are presented as false links, with a number and a link name, which shouldn't matter since the "real" links don't exist either.

The first macro allows you to trim down the results. The snippet "+[!prefix[1-]]" removes all the links with just one reference. You can add more snippets if you don't want to see other numbers (2,3 ,etc) It works this way because TW doesn't have number comparison tools.

Keep in mind that most of the links will result from camel-case code where the fix is to put a ~ in front of the false link.

-- Mark

Matthew Lauber

Oct 30, 2018, 1:31:19 PM10/30/18
to TiddlyWiki
Here's what I was able to come up with via vanilla TiddlyWiki.  I wasn't able to sort things, but I did let you set a minimum and maximum count to make it easier to find what you're looking for.

Linda Moss

Oct 30, 2018, 5:02:40 PM10/30/18
to TiddlyWiki

Thanks all! All three responses are very helpful :)

I can't find how you mark a thread "completed"? No button/option to do so is showing up for me.

Reply all
Reply to author
0 new messages