Make [[links]] more powerful

I have touched on this previously but the idea has now matured.

In effect, a link behaves like a button that triggers “open+navigate”. The obvious advantage with a link over an actual such button is syntax brevity. It would be very clunky if we had to create a button for each link as we author. As we author text content (as opposed to code), any need for widgets or complex macro calls steal attention and breaks the flow of thought. Only the simplest markup, such as italics, bold and bracket linking, can be internalized to not take you away from the sometimes needed authoring flow.

At the other end, we have the reader. The reader just wants the information and at as little mental cost as possible.

So, is this “open+navigate” behaviour the optimal way to serve the information to the reader? Here are a few other examples of how a reader can access information that, depending on situation, can be better for the user:

  • open but don’t navigate (instead read later). This can be achieved with Ctrl+clicklink but still I include it to illustrate my point.
  • open multiple tiddlers at once, and navigate to e.g top one
  • open as popup, i.e no navigation away from current
  • open “inline”, i.e transclude the clicked title

I would even go so far as to say that the typical “click+navigate” is rarely the best option! It is default behaviour because of habit. For example, the two latter bullets are particularly interesting because, as noted, it doesn’t break the readers focus as much as “open+navigate” does. Navigation, which is even animated, definitely breaks the reading spell. But this is nothing compared to the mental strain required for going back to the point where left off in the original tiddler. A “popup” or an inline transclusion should significantly lessens this strain.

Proposal
I think the [[link]] syntax should be extended. This could be done by using the “format” we already have for external links i.e [ext[link]] such as:

[popup[link]]
[transclude[link]]

…etc.

Maybe even a general:

[myactions[link]]

…to call a custom macro definition containing a string of actions.

In conclusion: Links are ubiquitous and elegant yet very static and limited. By extending the already existing [ext[...]] syntax, they can be enhanced to improve, especially, the authoring experience. Easily applied syntax will likely also result in an improved reading experience.

Thoughts?

10 Likes

This is very good and helpful thinking. Thank you!

Related thoughts:

  1. If you are writing text for yourself, there is no problem with what you suggest. You probably will know the behavior caused when clicking links you created for yourself. But if you are writing for others, such as an online wiki, that could create confusion or apprehension: “the last link I clicked on opened a popup, and the previous one navigated me to a tiddler. What will the next link do?” There would need to be some visual way to distinguish the link actions, maybe a small icon to the right of the link, or at the very least a tooltip.

  2. Three more for your list:
    a) link with thumbnail on hover
    b) link with option to add to favorites
    c) link with option to bookmark for later reading (similar to your first bullet but adds it to a list in a sidebar tab)

  3. The links will need to work in static htmls or at least revert to simple links in static html.

  4. For ‘open as transclusions’, you might consider some optional parameters:

[transclude bgcolor="" [
(for the background color of the transcluded content to distinguish it, or not, from the main content)

[transclude icon="" [
(to choose how to alert users of a different link action)

[transclude edit [
(to reveal an edit button to open the transcluded tiddler. This is one of my pet peeves of {{ }}, that you can’t click anywhere to open or edit the transcluded tiddler)

Anyway, see these caveats and extensions as saying that I wholeheartedly support this idea, and hope that whoever is able to do something like this will think through the issues and options needed for each kind of link.

2 Likes

Explanation:

My comments on transclude options comes from my work with slider macros.

I currently use three homemade sliders, spinoffs of the subsume plugin:

  1. A macro so that users who are in a table of contents to click to open a lower level toc under a section. Similar to the toc macro but where they are not links, and can be custom formatted. This macro also works as a slider under sections of an article. It has a button to navigate to the other tiddler. See the asterisked items in : Evangelios giffmex for an example.

  2. A macro so that in an article, users can see additional content under a line of text, or navigate to the other tiddler. See the + items here for an example.

  3. A macro similar to #2, but just to list the source of the content. I wanted a separate icon so that my users, who will probably want to see additional content but not the references to the sources, can distinguish the two. See the book icons here for an example.

These macros don’t break my writing flow. I have editortoolbar buttons for each, and either write content and wrap it with the macro, or paste the macro and fill it. The first one requires me to add a tiddler title as well as a caption. The last two create datetitmestamps for the tiddler title, so all I have to do is create a caption.

Obviously links are different animals from these sliders, and have pros and cons as opposed to this set up. But I mention my macros just to show some of the issues and use cases for the transclude link idea.

Mat,

It s important to raise such questions. Some thoughts;

First consider an alternative way to achieve what you want. Using transclusions;
{{This is some text within the text||more}}
In the more tiddler you can design range of ways to present the “currentTiddler” which is the text inside the transclusion. You could even include logic to decide what to do such as if a matching tiddler exists, or an entry in a data tiddler exists for that text.

Then a set of other transclusions such as {{some text||popup}} where the method to extend the text is decided by the author.

All of the above transclusions could be wrapped in a “Custom Markup” so you have a wiki-text symbol to mark your text.

Another method alternative to the popup is the tooltip. With or without markings to indicate a tooltip is present.

Finally I think the choice of what “more powerful link” to use is going to be content and wiki related, however a high degree of automation (eg < 100 characters give a tooltip, and > 1000 a link…) can be added to the transclusions I propose and the behaviour toggled as needed. You could also use the modifier keys both to create or view the same link in the way you or the reader chooses. Thus I am not sure of a need to extend the current link mechanism, but I leave that for you to argue.

Just ask if you want a working example.

As I did create the uni-link plugin I did think about these possibilities too. … It’s possible to do everything you wrote with links. eg:

  • We could replace transclusions with eg: [[tiddler alias|?}template]]
  • We could replace simple macro calls without parameters with eg: [[tiddler alias|?>macro-name]]

But as you can see, we would create a completely new syntax, with limited functionality … The reason why I didn’t implement any of those possibilities is: We have existing and “battle tested” solutions that work out of the box: macros and transclusions

But you are right, macrocalls are complex to type, if you don’t have toolbar buttons to insert them.


I did create the custom-markup plugin, which allows you to create your own syntax for block-elements like paragraphs and for inline-elements similar to the link syntax.

Custom-markup can abstract complexity away in the writing process. … BUT … to achieve this, you need to invest some work upfront. … So the “complexity” isn’t gone away, it’s moved around.

2 Likes

Yes, but take the proper credit @pmario, that time and effort is only invested “once”, upfront, not repeatedly, over and over, while you’re busy typing into a tiddler authoring “free text” and your head is (rightfully) somewhere else – to me, that solves most of what @twMat is asking for…

1 Like

Nearly all of the reasons I’d have for wanting alternative links are solved by tobibeer’s preview (on hover) plugin : plugins — docs for plugins by tobibeer

It suffices for those “Is this going to be what I hope it is?” moments, and also those “scan for quick confirmation of info” moments – all without losing focus.

It’s also lovely that tiddlywiki ALREADY builds on the on muscle-memory developed in browsers, where modifier keys shift the default link behavior. In particular, cmd-click (at least on my mac) already opens the tiddler without scrolling to it.

I’m not sure whether browsers will let tiddlywiki hijack control-click… but perhaps some other modifiers can be developed in ways that feel maximally intuitive and integrated with other navigational habits?

-Springer

1 Like

Folks,

I just wanted to let you know I have built before this thread started, a tiddler called linker which you use {{||linker}} or {{tiddlername||linker}} or the companion macro linker. Behind the transclusion there is a lot of intelligence, rather than a link, a button that looks like a link, with a range of additional features that can be configured, triggered or modifier key selected.

In short it can be used in lists, as a template and many other places and offers more powerful links as per the original post. I will share as soon as possible but have some obligations taking my time.

I have implemented some of @twMat’s desires, and the others are quite achievable with some tweaks or extension.

open but don’t navigate (instead read later). This can be achieved with Ctrl+clicklink but still I include it to illustrate my point.

  • A must and useful method.

open multiple tiddlers at once, and navigate to e.g top one

But how are the multiples selected?, with my linker you can use {{filter|linker}} and choose if a header appears at the top of the list, It is easy to include open all in the header.

open as popup, i.e no navigation away from current

Good Idea, Achievable! but competes with preview or extract as an option.

open “inline”, i.e transclude the clicked title

Good idea, perhaps also an Open in side bar or window as well.

There could be a lot to any link, the question is how densely we pile the features onto the humble list item or link, and how to choose the interface or key strokes to activate.

In idea I just had is tab into the list and hit enter to open below.

  • though I do not know how to do that it would be nice.

Post script
One can also use this solution in filtered transclusions as well.

You are right, the current behaviour can be confusing for readers or new users.

I don’t know if I understand you. Several behaviour with its own formar or alternative default behaviour?

If there are several behaviours in the same tiddler I think that it can also be confusing.

What do you think about a setting to config the default behaviour to click and ctrl/cmd+click?

Here is a use case for some kind of “extended link”:
I have lots of small tiddlers that contain snippets of text. For the sake of argument, lets say they are quotes. Like:
Title: Abe Lincoln
Text: Four score and seven years ago

Now I’m writing another tiddler and I want to have Abe’s quote transcluded so it appears in my writing as a block quote (not a popup) so I’d do:
<<<
{{Abe Lincoln}}
<<<
Where this falls down is, I’m also using Stroll that has backlinks. I’d like to go to my Abe Lincoln tiddler and find out where it was used. Since I transcluded rather than linked, it doesn’t work.
I know there is the Freelinks plugin that could solve this but that is only an option if your wiki isn’t that big (this one is huge).

If that has been solved, I’d love to see an example.

Thanks,
Scott

1 Like

This searches for one of three transclude shortcut patterns for a given title/string

\define search-transclude() {{$(string)$}}
\define search-transclude-current() {{||$(string)$}}
\define search-transclude-template() ||$(string)$}}
\define search-transcluding(string)
<$set name=string value="""$string$""">
<$list filter="[all[shadows+tiddlers]search<search-transclude>] [all[shadows+tiddlers]search<search-transclude-current>] ~[all[shadows+tiddlers]search<search-transclude-template>] +[sort[]]">

</$list>
</$set>
\end

<<search-transcluding "Abe Lincoln">>

Thanks, Tony that works perfectly. After my post I remembered about TW-Crosslinks which seems to work just fine in my huge wiki.
GitHub - akhater/TWCrossLinks: Discover all your intra-tiddlers links

1 Like

And you have reminded me of an unrelated Xlist tool of tobias xlist — crosslist by category its great for reference repositories.

Though TechLifeWeb’s needs are met by better by Tones’ and/or Tobias’s solution, the post reminds me that I’d love to see a variant of transclusion that is less stubbornly inscrutable in view mode. Transclusion is powerful, but occasionally I lose momentum in my workflow when I go to edit a tiddler only to discover that the part I meant to tweak is within a transclusion, so I have to back out of the edit mode and search for the source tiddler to edit (or select from a set of extended backlinks, if I implement that).

I imagine a transclusion GUI that draws a gently pulsing border around a transclusion iff it’s in the story river and it – or rather, a non-link part of it – is being hovered over. Just above the top edge of that border we see (again only on hover) the name of the source tiddler as a button that links to the original (maybe in edit mode). (I realize doing anything distinctive with transclusion css is tricky, since transclusions can be tiny or huge, and transclusions can bring their own style along. And I vaguely recall that only one “hover” behavior can be applied at a time, so transclusions that consist entirely of links and buttons wouldn’t work well unless some kind of buffer-zone padding could serve as a hot zone for the transclusion…)

Is something like this (a) technically workable? Is it (b) of interest to others?

-Springer

Are you talking about editable transclusions as in rider plug in or tobibeers inc plug in

1 Like

Thanks, Arunnbabu!

I will check those out; each has strengths. The opacity trick in the Rider plugin handles nesting really well, and I’m delighted to see that it’s pretty robust across palettes. The inc from tobibeer is much more visually subtle, and looks like it might be more powerful within filtered list widgets, dynamic tables, and such.

Both of them seem to be designed (understandably) for block text rather than inline.

What I’d really love, given the vast projects I already have developed, is a plugin that would recognize existing transclusions (as they already have been generated with {{splice content in here}} double-curly-braces), and make them behave in a special way on hover (when they appear in the story river). But that’s the thing that I suspect may be too much of a stretch to be worthwhile, given the order in which wikification / css / rendering happens. :wink:

-Springer

Springer I am confident we can already do something very close to what you ask. Someday I will share a project I am working on which has numerous what I call “Smart Transclusions”. Basically ways to transclude anything in a range of ways and with parameters including filters.

Mohamad’s recent Section Editor Plugin: First Stable Release uses another approach to edit inline, this can be used with a transclusion method as well.

A really simple example is;

{{namedtiddler||boxme}}

With the tiddler box me containing;

<div style="border: 1px solid gray; border-style: dotted; padding: 15px;">
<span style="float: right;">{{||$:/core/ui/Buttons/edit}}</span>
<$transclude mode=block/>
</div>

then use in a tiddler on tiddlywiki.com
{{Features||box me}}

Note the top right edit button.

However you could make this conditional on a tiddler or wiki mode.

Hi Tones,

This kind of behavior is in indeed very much the zone of what I have been desiring… But the hard question is whether a plugin could make this kind of GUI happen wherever ordinary transclusions already are in play – rather than requiring a massive search-&-replace to specify the template in this way.

If a plugin could catch all story-river transclusions this way, the behavior could be easily enabled on existing wikis, and just as easily disabled on the fly…, and I wouldn’t be re-learning how I write tiddlers, nor guessing whether this here random old tiddler was written at a time when I was using a special transclusion-template solution or not.

What do you think?

I have to give that more thought, and retrospectivity and backwards compatibility is important.

If a logical and reliable replacement algorithm is possible …

a massive search-&-replace

… is actually trivial on tiddlywiki.

However keep in mind via a viewTemplate you can have a section appear below any tiddler based on what is found in that tiddler. Including a new view of the same content. This is how many display relationship’s such as backlinks/references already.

On the topic of designing user interaction and styling transclusions, it might be interesting to know how Notion thought about it.

1 Like