Potential bug around backlinks and macros

57 views
Skip to first unread message

Rob Hoelz

unread,
Sep 9, 2018, 11:12:12 AM9/9/18
to TiddlyWiki
Hello TiddlyWiki community!

I know bugs belong on GitHub, but I thought this behavior I found merited some discussion before escalating to true bug status.

To more easily see how my tiddlers tie together, I have a view template tiddler that lists backlinks to the current tiddler under the body.  I also have a little macro I wrote
that I use to comment on ideas on my wiki, which looks like this:

\define feedback(text:"")
> $text$
\end

Here's an example from my wiki of how I use that macro:

"Backlinks" for commits (eg. in the case of a revert, or "Commit ABC123 did X, which was wrong because of Y) would be helpful

<<feedback "
One potential issue with is [[rebasing|

Can I get git-rebase to rewrite commits in message bodies?]]">>


I noticed that my "Can I get git-rebase to rewrite commits in message bodies?" tiddler didn't have the above tiddler listed among its backlinks - it turns out that backlinks work by building a parse tree for each tiddler and scanning them for link nodes, which my feedback macro doesn't do.

My question is: is this a bug? If not, what would be the best workaround, short of throwing redundant links into my tiddlers?

Thanks,
Rob

Jeremy Ruston

unread,
Sep 9, 2018, 11:29:41 AM9/9/18
to tiddl...@googlegroups.com
Hi Rob

I noticed that my "Can I get git-rebase to rewrite commits in message bodies?" tiddler didn't have the above tiddler listed among its backlinks - it turns out that backlinks work by building a parse tree for each tiddler and scanning them for link nodes, which my feedback macro doesn't do.

My question is: is this a bug? If not, what would be the best workaround, short of throwing redundant links into my tiddlers?

It is the intended behaviour.

To include generated links we’d have to not only parse each tiddler, but render it as well. Rendering is significantly more expensive than parsing.

In this example, perhaps you could store the text that you’re passing to the feedback macro in a separate macro. For example, you might adopt the convention that the title of the tiddler containing the feedback text is the base title plus the suffix “-feedback”. Then your macro might look like this:

\define feedback()
> <$transclude tiddler={{{ [<currentTiddler>addsuffix[-feedback]] }}} mode="block"/>
\end

To make it easier to access these “-feedback” tiddlers you might also add a new EditTemplate segment that provides direct access to it.

Best wishes

Jeremy.


Thanks,
Rob

--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/15a990d6-ad5d-436b-b05c-10c8c951762f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rob Hoelz

unread,
Sep 9, 2018, 10:58:34 PM9/9/18
to TiddlyWiki
Thank you for the advice, Jeremy!  I've been thinking about moving the feedback stuff into separate tiddlers, so maybe this is the push I needed.

-Rob
Reply all
Reply to author
Forward
0 new messages