Make [[links]] more powerful

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

I like that discussion (Notion designer on transclusion and GUI) very much. Thanks, alvorithm!

Since this thread was last active I made a tiddler that goes someway to the pattern discussed;

source-transclusions.json (1.2 KB)

The references is broken

Use in any tiddler {{tiddlername||source}} and tiddlername will be transcluded. Mouse over to see what that tiddler is.

If $:/config/author-mode contains “yes” a link to the source and a click to edit button appears at the right top/bottom of the transclusion.

You can use this method to style the transclusion block
<$let source-style="border: 1px solid gray; border-style: dotted; padding: 15px">{{Cosmobiology zoom notes||source}}</$let>

Also you can use the references[] operator to list on the transcluded tiddler where it has being transcluded, and I expect relink plugin to work if the transcluded tiddler is renamed. I included it in the above.

I am building this further,

  • perhaps a separate tiddler for inline transclusions.
  • also a variable or set of named classes
  • a method to have the view template applied to the transclusion.
1 Like