Using macro to generate link, but tiddler that is calling does not show up in backlinks

I like to add metadata to nodes when I’m working with Streams, such as [[project]], [[todo]], etc… Then I’m able to see all of those streams as backlinks on those tiddlers. I wanted to create a macro to format those links to create a visual separation between the rest of the node’s text. For example:

this is a thing I have to do #todo

I wrote the following macro to do this:

\define meta(tid)

<small> <$link to=$tid$> #$tid$ </$link> </small> 

\end

The macro works but whenever I use it to create metadata links on a node, the node does not show up in the backlinks of the tiddler that I linked it to.

Am I doing something wrong, or is there a better method to achieve this?

Thank you!

I think the backlinks need to see the [[tiddler name]], and only constructing it in a macro means it does not exist until your viewing each tiddler in which the macro is used. Rather than use the macro perhaps use styling as below;

  • The backlinks should work this way.
<style>
.s {
 font-size: 0.7em;
}
</style>

Something <span class="s">#[[todo]]</span> something else.

Something @@.s #[[todo]]@@ something else.
  • of course you would move the above styling to a tiddler tagged stylesheet
  • The second option is the minimum characters approach I can think of
  • We could make an editor toolbar button with keyboard shortcut to apply this class.
  • the “s” for small class can be applied in the same way elsewhere *.s Head

Other options may exist depending on your wiki and use case;

  • Eg restyle all default links (within the stream node)
1 Like

Thanks, @TW_Tones ! I think the stylesheet sounds like the best option. I just tried it out and it works perfectly. And it has the benefit of being able to format multiple metadata links at once rather than calling the macro several times.

You’ve given me some good ideas. I think I might look into adding the class by default in new streams.