Discussing - Notes on Tiddlers stored in a Data Tiddler

This is a thread to discuss the Tips and Tricks post which is a Wiki page

Tips and commentary - Notes on tiddlers stored in a data tiddler

A post was split to a new topic: Multiple tips and Tricks using discussing a code example - data tiddler to store Notes about tiddlers

There are a lot of instructions here. Is this something you can package up as a plugin or JSON bundle? I would love to be able to test the functionality before I decide if its something I want to invest my time in.

The intention is to present a readable guide, here in talk.tiddlywiki. Not a plugin or JSON Bundle. I may publish one later, but only once a few issues are delt with. If you think it is too long and you cant foresee learning something, then please just don’t bother with it.

  • This is why it is here in Tips and Tricks rather than a discussion, plugin or package.
  • If people get something from this (and let me know) I will publish more like this.
  • I also produce research tiddlers for myself that collects the results of research into a particular mechanism to help me understand, tweak, utilise etc… One day I may publish those which could help someone wanting to understand or hack TiddlyWiki.
    • For example, I am currently researching the rename mechanism with a view to enhancing this notes database solution.

In my defence by delving into the code as documented here there are easter eggs, tips/tricks/hacks and code patterns the reader may value, which they only learn indirectly when someone else give targeted solutions when someone has a problem. This is a proactive approach to learning.

Alternatively, can you provide a few screenshots? I’m not sure I want to delve into examining all that code without first understanding what you are attempting to accomplish.

OK fair enough, I will add it to the top wiki post, but It will be later as I am out to lunch :nerd_face:

  • May add a overview of the solution it creates with the screen shots to the wiki post.

I am attempting to accomplish “Publishing an opportunity to learn”, not simply get the end result.

  • If you don’t want to learn, don’t bother reading.

Later I may publish a solution that does what this example documents.

The first example is executable, which you can test.

1 Like

You see, I can’t tell from your post if there’s something there that I’m interested in learning.

Your first paragraph says

The following is a TiddlyWiki script solution to place multi-line notes on any tiddler, with wikitext, but stored in a data tiddler. This means the tiddler on which the note is added is not touched.

I read this and said to myself, “I already know how to do this. We’ve discussed similar things a number of times here.” I also saw it in the discussions of flags Tones recently started. I’ve never specifically done notes. But I’ve done similar-enough things that this doesn’t affect me. I’ve also never stored the results in a single data-tiddler, usually spreading out the information across many related tiddlers, but I’ve progressed far enough in my TW journey that this is something I can do easily.

So I skipped the explanation, and added the first example to the main site, and saw the behavior. There was a note and it was stored outside the tiddler itself. Got it. I looked up a little and saw $:/tags/Global, so I added that, and added the procedure call to another tiddler. “Look at that, they’re independent. Ok, so how’d he do it?” I glanced at the code, and quickly focused on the $transclude widget near the bottom, saw that it uses <<note-database>>, looked that up near the top, and found that it’s just a single tiddler. I checked that tiddler and the data is stored in a JSON tiddler.

So now I have to decide if this is worth it to me. There are another 1500 words or so in the post, including maybe a dozen code samples. I have no idea where this is going. What’s the end-state? Or is this all explanation for the code sample that preceded it? a scan of the headers doesn’t really tell me. And I make the decision that it’s not worth my time unless I can find out what it is we’re trying to reach. When I ask for that, I guess I find out that I’m not interested in learning. :exclamation: :question:

The subsequent discussion makes it seem that there is not much more, just an explanation of how this first snippet was accomplished. That’s certainly a useful thing to explain. But for me, unless I have extra free time, I’m not likely to bother.

Right. As I said above, I could not immediately tell if that was just table stakes to be expanded upon or was the end goal on its own.

I’m with you, Scott. On first reading I felt adrift without rudder or compass. I’m still not sure I have a firm grasp of where it’s going. That said, here’s my current “where I’m at”…

I think because of TW’s declarative nature, the “net effect” of what is proposed is kinda already present – TW lends itself to this kind of approach OOTB. The proffered “solution” doesn’t feel like it solves anything – a solution in search of a problem, perhaps.

One part that confounded me is the notion that a notes database is even needed. It feels like an unnecessary level of abstraction. My TiddlyBook system does all this (irony: demonstrated in part to @TW_Tones and @nemo just prior to this post going live) – complete CRUD too – no database/data-tiddlers necessary.

In fairness to @TW_Tones, I think he was pushed into posting this wiki-post here when in fact it isn’t ready. It’s a research project that may have a few tricks that others may find useful. It certainly shouldn’t be presented as a solution in Tips & Tricks when CRUD is not fully supported (yet).

I think there probably are times for this, mostly when you want to avoid a large proliferation of dependent low-complexity tiddlers. This is one of several designs I’ve considered for when I finally get back to my periodic table work: I want users to be able to add their own blocks of information to the Element and Compound tiddlers, but want those tiddlers to remain pristine. This is one technique that would allow for that. I have several other possible techniques, and this one is low down on the list, mostly in an “if everything else fails” manner, but it’s reasonable.

Usually, though, I’m not worried about tiddler proliferation. And it’s easy to add dependent information to other tiddlers that link back to my main one, explicitly with some sort of parent field or implicitly with a naming scheme. (title: MainTiddler/note1).

I am slowly coming to believe that (as I believe Jeremy has suggested) that data tiddlers are mostly a distraction in our “Everything’s a tiddler” environment. But I really doubt they’re going away.

I’ll have to look for that. If it was public, I missed it.

If you use CRUD for create, read, update and delete. It is all possible. If you copy paste the initial example into TW you’ll get all the CRUD elements.

There are some usecases, where data-tiddlers make sense, that’s why we can not remove them.

  1. They are convenient for configuration settings like our palette
  2. For a huge amount of read-only data
  3. For convenience if you only want to move 1 file
  4. Data logs, audit logs 1 line per log info
  5. … others

Especially for 3) many users go a long way, even if technically it would be easier to avoid data-tiddlers.

For my personal wiki, I used them because data tiddlers contain content in the text-field, which is searched in TW by default and I wanted to use them as a timestamped, auditable link log

3 Likes

The data-tiddler is not required for zero-touch. And I take your point where you reference Jeremy’s thoughts – 100% agree. But let’s not conflate zero-touch with the “trick” to use data tiddlers. (Re)consumption/transclusion of a data tiddlers is not as straightforward as a regular tiddler. I’d say most users stick to regular tiddlers.

Zackly. <tiddler-title>-notes here (plus <tiddler-title>-info <tiddler-title>-plot, etc.

It’s starting to sound like I think the OP is a terrible idea – NOT TRUE! I just don’t know what it is… or “why”.

But not Rename. Without intrinsic renaming, it’s a footgun. In some circles it was touted (years ago) that the “R” should be “Rename” – Read after all is a given (I’m reminded of an extremely old April fools joke about “WOM” - write only memory :laughing: ).

And yes, I tried the example when it was posted in another thread. It works. But again, not sure what the benefits truly are.

IMO, the major points of Tony’s no-touch approach:

  • All notes added via this tool are stored in the same data tiddler — $:/note-database, as defined in the procedure in the OP.
  • This data tiddler is a system tiddler, so it won’t show up in standard searches.
    • This contrasts with the vanilla “make a child tiddler” approach — and IMO, search pollution is a major downside of the everything-is-a-tiddler approach. I don’t want MyTiddler/notes, MyTiddler/to-do, and MyTiddler/42 all showing up every time I search for “MyTiddler”, particularly if they’re only ever going to be displayed or modified via a ViewTemplate on MyTiddler itself.
    • Of course, this “downside” of separate tiddlers can also be avoided if you give all your “child” tiddlers the system prefix.
  • This data tiddler is a single tiddler, so it’s easily portable in a way that child tiddlers aren’t (unless you know how to write the necessary filter to catch them all — and even then, dragging-and-dropping a single tiddler will always be easier.)

I think these points make this a good approach if you have a collection of user notes that you want to quickly transfer between wikis — say, documentation notes for various $:/core tiddlers. It would also make it easy to share notes of this sort with others in a non-destructive way.

Edit: Another potential use: collecting feedback or annotations from multiple reviewers.

  • For this use-case, I’d probably want to extend the procedure to support displaying notes from any/all of a selected set of data tiddlers (which should probably all have a certain tag or prefix to make them easy to collect).
  • With a little extra tinkering, you could set this up to be quite friendly even to people who’ve never used a TW before. Prompt them to choose a username when opening the wiki, generate the data tiddler title from that username, and then provide an “export” button to save their notes (or even mail them directly to you?) when they’re done.

Perhaps it could enable a “Guide to TW” plugin, as suggested by @twMat? You could then enable or exclude notes from your (least) favorite contributors, as someone else requested…

3 Likes

Agreed. But I think there are notable exceptions. Another thread explains what I think might be a motivating example, and I can think of another simple one:

{
  "HelloThere": {
    "score": 4, 
    "comment": "This is fine for the moment, but some eventual modernization wouldn't go astray", 
    "priority": 8
  },
  "Quick Start": { /* ... */ },
  /* ... */
  "Creating Substories": {
    "score": 3,
    "comment": "The explanation is reasonable, but it's lacking motivation.  //Why would I want this?//",
    "priority": 3
  }
}

Imagine a tool that let you build a JSON tiddler like this, paired with a ViewTemplate that displayed this information on all non-system tiddlers and a summary tiddler that lets you find all priority 1 element, sort by score, etc.

You could drop my version of this on the main site to see what work I think needs to be done. We could collaborate on a shared version. But it’s extremely unobtrusive, adding only a handful of tiddlers, even though it updates your view of everything.

There are plenty of other possibilities. I still don’t think I’d want it very often, but I can see times.

Edit: It looks like @etardiff beat me to the example (“documentation notes for various $:/core tiddlers”.) Great minds, and all!

2 Likes

Ouch. That point had completely escaped me. Thank you!

@Scott_Sauyet @etardiff (@TW_Tones)

I think it fair to say, I’m suffering from a failure of imagination. Thanks, both.

1 Like

Not something I would say about you.

Ever.

1 Like

I agree with @etardiff comments and can see a use for Journal Tiddlers / Calendar Events having attached notes via single or multiple $:/note-database tiddlers.
You could have smart-tabs on a tiddler providing a variety of note topics, categories or projects.
(along the lines of this discussion on the non-JS Calendar by @hoopyfrood and @arunnbabu81 if your interested}

Did you @Scott_Sauyet and @CodaCoder not read the second paragraph in the first post?

Scott, You have being in a range of activities over time, and only you can decide if your are going to make use of this. This solution is different to Flags in a number of ways, the notes are multiline/text area notes. :thinking: perhaps this could be how flags work, note enabled. Select from multiple notes data tiddlers to organise the resulting notes, more than one external note for a tiddler?

All the snippets are pulled out of the first code block and explained.

But the post is less about the solution and more about the details in the code.

Are you assuming there is nothing you can learn in the details? The code actually uses backticks crafting a tooltip, shows pragma inside procedures, leveraging the popup attribute for toggling content, shows short and long form of %if, using functions for easy to read conditions, doubling as the retrieval of database records, loading a button with multiple forms of action at once, highlighting the need for tc-popup-handle class, Using a macro in a filter, using blank lines and indents to make code more readable, leveraging other html tags on button content, multi-line data tiddlers, wikifying such content and more…

But its not all about anyone of us, in the community there are all matter of different knowledge levels, there are people like me who like to comb through “interesting” examples of how people do things. As my expertise grows I like to see the details and code tricks people use, so if someone else publishes something like this I will gobble it up.

As I said previously it was not about the solution so much as explaining the code to implement it. So I am somewhat reluctant to defend the solution, here. This is a Wiki Post permitting collaboration overtime to make it clearer. However;

This solution within this code discussion provide the ability to place notes against any tiddler without touching that tiddler, the note is multi-line and can include wikitext. The notes are all stored in a single tiddler which can be dropped on another wiki, so may be helpful to documenting the core tiddlers, or to send to a wiki author for review.

  • It would be easy to adapt this to save notes in separate tiddlers
  • I am currently preparing a view template to look at this standalone note data tiddler separately.

Well this is the first example of pre-emptive publishing with code description. Its a first example and can be improved with contributions. Improved for the reader not necessarily the solution. But yes I wanted to publish before I moved address tomorrow.

I want the community to help me explore this way of discussing concise solutions in detail, with a view to making “explicit” tips and tricks that are often “implicit only”.

I am open to constructive criticism but would prefer collaboration

Perhaps this will inspire similar sharing of Tips and Tricks or inspire different solutions ?