Roam-y style linking for TiddlyWiki, first attempt

213 views
Skip to first unread message

David Gifford

unread,
Jan 25, 2020, 2:55:13 PM1/25/20
to TiddlyWiki
Hi all

Here is what I am playing with. Thanks to Mat and Mark for their help so far. Still need help, from them or others, to get this right! (see the link for the help I need)


Dave

Mark S.

unread,
Jan 25, 2020, 4:46:14 PM1/25/20
to TiddlyWiki
Per your notes, it looks like you'll want to show context.

<Cough> <Cough> Something like PR 2963 would make extracting context much easier.

Oh well.

Checking the tiddlywiki toolmap (have you heard of it?) I found


It looks like Danielo's "context" widget might do what you want.

David Gifford

unread,
Jan 25, 2020, 5:55:50 PM1/25/20
to TiddlyWiki
Thanks Mark for your help on the mycrit definition! Worked like a charm!

As for the context plugin, it did have a list filter option, but it seemed pretty tied to $:/AdvancedSearch, which I am guessing is not invoked for this kind of list. The list filter example Danielo had was for a list-search. Also, this plugin is really old. Danielo still has tw- styles. Those got changed several years ago. I tried changing those to tc- in the plugin but didn't help.

I installed and refreshed the plugin, but this did not work:

\define mycrit() (?i)\b$(currentTiddler)$\b

<span class="serif">(click any gray box below to access its tiddler)</span><br><br>
<$list filter="[!is[system]regexp:text<mycrit>sort[title]] -[is[current]]"><strong><$view field="title"/></strong><span class="indent1"><$link><span class="graybox"><$context term={{$:/temp/advancedsearch}} /></span></$link></span></$list>

Mark S.

unread,
Jan 25, 2020, 7:06:15 PM1/25/20
to TiddlyWiki
The great thing about TW is how backward compatible it is.

This seems to work:

\define mycrit() (?i)\b$(currentTiddler)$\b
<$vars searchme=<<currentTiddler>>>

<span class="serif">(click any gray box below to access its tiddler)</span><br><br>
<$list filter="[!is[system]regexp:text<mycrit>sort[title]] -[is[current]]"><strong><$view field="title"/></strong><span class="indent1"><span class="graybox"><$context term=<<searchme>> /></span></span></$list>
</$vars>


Note that there is an undocumented (?) 3 character search term minimum. So my title "Hum" failed to work. But "Hummus" was much better. (I felt bad, and then I falafel.)

I would imagine figuring out the fix for styles should be easy for the CSS experts in the forum.

David Gifford

unread,
Jan 25, 2020, 11:20:25 PM1/25/20
to TiddlyWiki
Thank you, Mark, that made the Context search work. I also added a little CSS magic.

I don't know if this was a problem before, or just started with these changes, but now tiddlers with parentheses in the title do not list anything.

Mark S.

unread,
Jan 26, 2020, 12:40:13 AM1/26/20
to TiddlyWiki

Well, the regexp needs to be escaped. Here's one attempt:

\define mycrit() (?i)\b$(searchspx)$\b
<$vars searchme=<<currentTiddler>> searchspx={{{ [<currentTiddler>escaperegexp[]]}}} >


<span class="serif">(click any gray box below to access its tiddler)</span><br><br>
<$list filter="[!is[system]regexp:text<mycrit>sort[title]] -[is[current]]"><strong><$view field="title"/></strong><span class="indent1"><span class="graybox"><$context term=<<searchme>> /></span></span></$list>
</$vars>


But there seem to be some edge cases still. I'll let you discover them  ;-)

It might be that the regular expression needs to be tweaked in unexpected ways.

David Gifford

unread,
Jan 26, 2020, 10:49:51 AM1/26/20
to tiddl...@googlegroups.com
A big thanks to Mark S. for all his help yesterday!

Here is the link again, to the updated file: https://giffmex.org/experiments/roamwiki.experiment.html

  • Bi-directional linking between tiddlers
  • Based on both linked and unlinked references to the current tiddler's title
  • Regardless of capitalization
  • Options to view as simple links, as transcluded tiddlers or as highlighted search results in context. Or just hide them.
    • Thanks to Danielo's context plugin.
  • Snowgoon88's comptext plugin makes linking faster, too. We take off our hats to him or her, and to the fallen 87 snow goons who went before.
Two notes:

1. I used checkboxes to toggle each viewing option on or off. I am sure there are ways to make a button that both adds a tag to one tiddler and removes tags from other tiddlers, but the TiddlyWiki documentation lacks examples of how to do that. Very strange omission.

2. For anyone who wants to tweak and bundle this as a plugin, be my guest. The relevant tiddlers are listed in the file.

Mohammad Rahmani

unread,
Jan 26, 2020, 10:00:47 PM1/26/20
to tiddl...@googlegroups.com
Hi David,

Great tool.
Two comments
--from introductory one cannot understand what is the difference between linked and unlinked
add a little descrition like linked (e.g `[[test]]`) and unlinked (....)

-- Flibbles Relink plugin actually finds all type of reference in a tiddler why not share your idea with him and see how use his code in this Roam app.

--Mohammad



Best wishes
Mohammad


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e65101ba-c1ee-4e8b-88ad-dce33a773dd8%40googlegroups.com.

HC Haase

unread,
Jan 27, 2020, 5:02:45 AM1/27/20
to TiddlyWiki
Very interesting.. I will have to play a bit more with this.

Your bi-directional linking thread (and roam) was what got me inspired to make the TOC generic plugin. Please have a look. My plugin shows all references for all tiddlers, but only when they are there. It is my attempt to make connections more visible.
This experiment however is interesting because you can see the information inside the tiddler and not just lists.
Maybe you could use some of the TOC generic plugin, to only show the menus if there is something in them.

I will explore this more.

Jack Baty

unread,
Jan 27, 2020, 6:48:31 AM1/27/20
to TiddlyWiki
I've been practically living in Roam for the past six weeks and the way it handles and presents bi-directional linking is the game changer for me. It's the context that makes all the difference. I display backlinks in TiddlyWiki all the time, but only seeing the linked tiddler's title isn't that helpful. It forces me to click the link and scan the target tiddler for the actual reference. With Roam, that context is always right there. This is the critical part for me. 

Thanks for working on this, Dave. It's very Roam-like! :)

Jack

David Gifford

unread,
Jan 27, 2020, 9:14:29 AM1/27/20
to TiddlyWiki
Thank you all for your comments:

Jack: Any thoughts on other ways to make TiddlyWiki function more like Roam, or even better?

Mohammad and HC:

Mohammad I will make the reference to 'linked and unlinked' clearer.

HC yes, I saw your TOC generic and in a way was trying to improve on it to make it more Roam-y. Thanks for the inspiration. But I think yours is probably superior in one way since it grabs references to tags and list field, etc. I need to study your plugin and Flibbles Relink to see how they scan for references. That may be beyond my skill level, but you never know...

Here are the new ideas I have to make this even more interesting, and I know how to do all these and hope to do them today:

1. Hide tiddler titles in transclude view. Just pure notes. The gray boxes are links to the tiddlers anyway. Would be the default viewing option.
2. A tweaked clone button that adds a link to the parent tiddler to the new tiddler. Great for creating notes, say, when reading a book. They automatically get viewed in the book's reference section.
3. A new journal button with datetimestamp to the second, for loose notes.
4. Incorporate the full screen editor plugin.

I was testing the Roam-y yesterday afternoon, reading electronic books on the Bible and adding sources and notes. This already turbo-charged my note taking. Imagine how it will be with the changes above. This is exciting. This burst of inspiration from Roam may be just what TiddlyWiki was waiting for.

Jack Baty

unread,
Jan 27, 2020, 9:50:38 AM1/27/20
to TiddlyWiki
I've been keeping a TiddlyWiki vs Roam tiddler here: https://rudimentarylathe.org/#TiddlyWiki%20vs%20Roam

The bold bits are what I find most valuable with Roam. With TiddlyWiki, I feel like between automatic, contextual backlinks, direct links from transcluded content to its source, and automatic tiddler creation I'd feel 90% of the way there. Just that :).

David Gifford

unread,
Jan 27, 2020, 10:00:47 AM1/27/20
to TiddlyWiki
How would you like 95%? My Roam-y, especially with today's changes, already take care of your bolded stuff. :-)

Jack Baty

unread,
Jan 27, 2020, 10:28:51 AM1/27/20
to TiddlyWiki
Consider me excited! :).
Reply all
Reply to author
Forward
0 new messages