Can we customize internal links?

90 views
Skip to first unread message

Stobot

unread,
Mar 23, 2021, 6:41:26 AM3/23/21
to TiddlyWiki
I had an idea today and am trying to figure out how difficult it would be to do. Say we use TiddlyWiki for project management (as I do), we will be writing "journal" type tiddlers and using as many links as possible for future reference. 

For example: "On [[2021-03-23]] I had lunch with [[Bob Ross]] and talked about [[Painting]] and his favorite place to paint which is [[France]]"

Now, I know that:
  • [[2021-03-23]] is a tiddler that is tagged "Date"
  • [[Bob Ross]] is a tiddler that is tagged "Contact"
  • [[Painting]] is a tiddler that is tagged "Hobby"
  • [[France]] is a tiddler that is tagged "Place"
Is there somewhere that I can insert logic to add to the logic of the internal link that is ultimately rendered? For example, for a "Contact", I might have "profilepic" in a field for [[Bob Ross]], and on the tooltip/hover I might want to display his picture, for the date, maybe a calendar tooltip, and for Hobby, maybe a list of other hobbies, or maybe recent entries also related to Painting. 

I could use macros instead of links and insert logic there - such as use <<mylink "Bob Ross">> and in the macro check for the tag and insert all of my stuff, but then I can't use things like CompText, backlinks probably wouldn't work etc. 

Any ideas?

Mat

unread,
Mar 23, 2021, 7:00:51 AM3/23/21
to TiddlyWiki
You can probably make a macro to call like <<link "Bob Ross">> and the macro checks up what type of tiddler "Bob Ross" is and acts accordingly. Maybe the $LinkWidget can also show wikitext tooltips that uses the current title (i.e the linked to title) as argument - I don't know if this is possible.

What I would much rather see - so it doesn't disturb the workflow when authoring - is a direct logic that is invoked when using the [[...]] syntax, because this syntax is "the smooth one". It could be attached to some template but what exact template to apply could be customized based on some characteristic of what is linked. E.g "Bob Ross" is tagged Contact so the contacttemplate is used. Maybe it could even specify what happens when the link is clicked! This would make it possible to have [[bobross]] [[BobRoss]] and [[Bob Ross]] all navigate to [[Bob Ross]].

Just maybe PMarios linking plugin, whose name just escapes me, uses something like this...

<:-)

Jeremy Ruston

unread,
Mar 23, 2021, 7:19:38 AM3/23/21
to tiddl...@googlegroups.com
Hi Stobot

You should be able to do this with the <$linkcatcher> widget; it lets you trap navigations (ie clicks on links) and runs custom logic in an action string:


Best wishes

Jeremy


--
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/7158dcda-b8d3-44cd-afb5-fa099865f448n%40googlegroups.com.

Stobot

unread,
Mar 23, 2021, 7:22:58 AM3/23/21
to TiddlyWiki
We're on the same page Mat - sorry if I was unclear, while doing a macro is possible, my question instead is how to hijack the normal [[...]] logic as you've implied.

I'm guessing it's either something I can tweak in "Inline Parse Rules", or a modification / additional javascript around the wikification process itself.

Stobot

unread,
Mar 23, 2021, 7:24:34 AM3/23/21
to TiddlyWiki
Thanks Jeremy - that would help for Mat's use case of a custom action on navigate - I was hoping for something in the hover / tooltip area. Is there anything similar?

Jeremy Ruston

unread,
Mar 23, 2021, 7:27:19 AM3/23/21
to tiddl...@googlegroups.com

Thanks Jeremy - that would help for Mat's use case of a custom action on navigate - I was hoping for something in the hover / tooltip area. Is there anything similar?

-- 
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.

Stobot

unread,
Mar 23, 2021, 7:32:56 AM3/23/21
to TiddlyWiki
Beautiful! Thanks Jeremy

Stobot

unread,
Mar 23, 2021, 7:47:32 AM3/23/21
to TiddlyWiki
For anyone else, I'll just post a picture of what this looks like when implemented - this is an entirely new way of saving time and adding context to notes for me. Now I can't do images like I originally imagined, but I can do some icons / emoji like shown below. Example here is information stored on the project, hovering over a link which has a tag of Project. 

screenshot.png

Mat

unread,
Mar 23, 2021, 12:08:04 PM3/23/21
to TiddlyWiki
This discussion triggered this thread in gh. Feel free to join in.

I think plain bracket links could be much more powerful than they currently are.

<:-)

Reply all
Reply to author
Forward
0 new messages