list-links output: suffix/append field

82 views
Skip to first unread message

András Novoszáth

unread,
Feb 18, 2017, 11:57:24 AM2/18/17
to tiddl...@googlegroups.com
Perhaps these are obvious questions in which case I am sorry, I just started to learn about tiddlywiki. I also searched for answers to them in forums but without much success (the nearest solution I found here).

I would like to list 'missing' tiddlers (i.e. having a link defined somewhere but without content) in the following format:
  • Title_of_missing_tiddler's_backlink: Title_of_missing_tiddler
1. My question is how can I put this together. The following line creates the first part of the format until the colon, but I cannot manage to append after it the title of the missing tiddler:

<<list-links filter:"[all[missing]backlinks[]addsuffix[: ]]">>

Bonus questions:

2. When I add the addsuffix[: ] to the line the output becomes initialized. Why is this so?

3. In case it is possible to list the missing tiddlers in the above format and if there are missing tiddlers linked at multiple places, then the output would list these  multiple times for each backlink(?). Instead, is there a way to have the output in the following way?
  • Title_of_missing_tiddler:
    • Title_of_missing_tiddler's_1st_backlink
    • Title_of_missing_tiddler's_2nd_backlink
    • ...

András Novoszáth

unread,
Feb 18, 2017, 1:33:33 PM2/18/17
to TiddlyWiki
Since then I realized two things:
  1. As for the 2. question, the output does not become initialized but italicized :)
  2. This interestingly happens as if TW, with the additional string at the end of the lines, would recognize them as non-exising, missing links. A

Eric Shulman

unread,
Feb 18, 2017, 4:39:31 PM2/18/17
to TiddlyWiki
On Saturday, February 18, 2017 at 8:57:24 AM UTC-8, András Novoszáth wrote:
1. My question is how can I put this together. The following line creates the first part of the format until the colon, but I cannot manage to append after it the title of the missing tiddler:

<<list-links filter:"[all[missing]backlinks[]addsuffix[: ]]">>

Bonus questions:

2. When I add the addsuffix[: ] to the line the output becomes initialized. Why is this so?

The filter in the <<list-links>> macro is used to *select* the list of links to show... however, the filter is not used to *format* the output.  The <<list-links>> output format is always a bullet list, and there are no macro parameters that you can add to change that.

However....

The <<list-links>> macro is just a specific use-case of the underlying <$list>...</$list> widget syntax, which gives you much more control over the list generation and output formatting.

In your case, you could start with something like this:

<$list filter="[all[missing]backlinks[]]" variable="missingTiddler">
   <$link tiddler=<<missingTiddler>><$text text=<<missingTiddler>>/></$link>:
</$list>

Note: the above example is just to illustrate the use of custom formatting for the <$list> widget output.. but I'm not sure you have the right filter syntax for what you are trying to do...

3. In case it is possible to list the missing tiddlers in the above format and if there are missing tiddlers linked at multiple places, then the output would list these  multiple times for each backlink(?). Instead, is there a way to have the output in the following way?
  • Title_of_missing_tiddler:
    • Title_of_missing_tiddler's_1st_backlink
    • Title_of_missing_tiddler's_2nd_backlink
    • ...

Try this:
Missing tiddlers and the tiddler(s) that link to them:
<ul>
<$list filter="[all[missing]]" variable="missingTiddler">
   
<li><$link to=<<missingTiddler>>><$text text=<<missingTiddler>>/></$link>:</li>
   
<ul>
   
<$list filter="[<missingTiddler>backlinks[]]" variable="backLink">
     
<li><$link to=<<backLink>>><$text text=<<backLink>>/></$link></li>
   
</$list>
   </
ul>
</$list>
</
ul>

Hopefully, the above example will give you a start on using the <$list> widget, which is one of the most powerful bits of functionality in TiddlyWiki.

Let me know how it goes...

enjoy,
-e
Eric Shulman
TiddlyTools: Small Tools for Big Ideas (tm)
InsideTiddlyWiki: The Missing Manuals

Reply all
Reply to author
Forward
0 new messages