Alternate version of "Notes on tiddlers stored in a data tiddler" (VERY long!)

I haven’t had time to do more than skim, but I’m already boggling at the sheer amount of work you put into this writeup. Bravo!

I’ll just respond to one part that jumped out at me…

This is a general quirk of the way that variables are handled in filters — i.e., when a variable is undefined, it’s treated as a blank value, but not a null one. So [<count>else[0]] won’t produce 0 when <<count>> is undefined, because [[]else[0]] gets (unhelpfully) evaluated to [[]].

Introducing the mathematics operators “solves” the problem because (quoting from that page)

If the argument cannot be interpreted as a number, the value 0 is used (e.g. foo is interpreted as the number 0)

So you could in fact omit the else[0] entirely and get the same result from [<count>add[1]subtract[1]]. But for a more semantically sensible fix, I’d recommend [<count>!match[]else[0]] or [<count>!is[blank]else[0]]. :wink:

1 Like

Thanks. After writing it in vscode and porting it to TW… then having to break it apart for size reasons (anyone found out before that there’s a 32000 character limit to posts?) I was sure there would be such issues. I will fix them this evening, or during breaks during the remaining work day. If for some reason you want them sooner, everything is at https://github.com/CrossEye/TW5-SuppNotesDemo/tree/main/post.

Thank you. That one was driving me nuts!

1 Like

Why not [<count>add[0]] or even [<count>add[]]? Seems to work.

Even simpler! Thanks. I’m not going to update the posts as they stand, but I will at some point add a few more steps with suggestions made here.

1 Like

I can’t believe I hadn’t thought of it before! I discovered it while building this, but have already used the same technique twice more. It’s such a simple debugging help and trivial to create.

1 Like

I’m sure you’ve noticed, but it’s worth remarking that links within this notes JSON tiddler are not “seen” by the relink mechanism. (If my note has a link to [[HelloThere]], renaming that tiddler results in a “dead link” in my note.)

I understand that’s not within the scope of what you can do from within your package here. And the risk of totally losing connection for notes on X by renaming X is a much bigger priority!

Still, the tutorial at Step 10 might want to flag this as another loose end.

1 Like

That’s a good point. I will look to see how Relink extensions work, and if it’s something we could add to this. That may not be soon, though.

rather than “specific tiddlers” why not have a filter? I just put it into the view template itself as a filter field. And changed the <% if … %> condition to take out your is[tiddler]!is[system] since someone might actually want this template to appear on system tiddlers or even VIRTUAL tiddlers (make a note on a missing/virtual tiddler, and have the template work fine)…

<$let templatefilter={{$:/supp-info/notes/view-template!!filter}}>
<% if [<currentTiddler>subfilter<templatefilter>] %>

(and close this let towards bottom as needed)

1 Like

Aspects of relink have been integrated … since v5.1.14, then v5.2.2 or so, yes? Even if there are advanced features that are still queued up for v5.4.0 …

(So, ordinary novice users now are used to having most user-facing connections “just work” on rename — perhaps noticing that there’s a checkbox for tags and list field updates — even if they have no memory of a time when preserving links across a rename was a fragility-point solved by a plugin.)

Your project here would just need to be bundled with another “sub-plugin” for relink (which seems to have 4 now?), if I understand correctly.

(If v5.4.0 is going all-in on integrating the robust set of @Flibbles Relink plugin functions, then I guess you would then no longer require a “sub-plugin”, but Relink-within-supp-notes would be an ordinary plugin to which the core would be directly receptive. Presumably many solutions that store data differently may want to be paired with relink-ish tweaks.)

1 Like

Good point. I’ve updated the TODO list with this.

That sounds right, and I have no issues creating plugins when necessary. At the moment, this is just distributed as a JSON bundle. Including a plugin feels odd. But I will investigate at some point.

1 Like

Thanks @Scott_Sauyet for you contribution, I will certainly work through this when I get time at my desktop. I do think walkthroughs are helpful to many users on their learning journey so great work.

2 Likes

This will significantly increase the workload for documentation. However, it will make reading less stressful for the reader.


I finished reading, but skipped a lot of content. My takeaways:

Learned some JSON manipulation techniques.

Discovered where to learn how to create new filter operators using JavaScript.

Found out where to learn how to set hooks with JavaScript to trigger automatic updates during renaming.

There’s a claim circulating that with the release of Gemini 3, front-end developers could be entirely eliminated. It remains to be seen whether this complex project can be completed solely by Gemini 3.