Add some line spacing between bullet points (from list-links macro)?

89 views
Skip to first unread message

teo...@gmail.com

unread,
Nov 15, 2020, 5:24:59 AM11/15/20
to TiddlyWiki
Hello, I would like to slightly increase the empty space between bullet points generated by:

<<list-links "[tag[tagName]]">>

(I'd like this to affect only the space between the generated links, and not within a single link if the link takes multiple lines. So the end result is increased readability of lists of long links.)

Thanks!

Eric Shulman

unread,
Nov 15, 2020, 6:54:47 AM11/15/20
to TiddlyWiki
On Sunday, November 15, 2020 at 2:24:59 AM UTC-8 teo...@gmail.com wrote:
Hello, I would like to slightly increase the empty space between bullet points generated by:
<<list-links "[tag[tagName]]">>

To implement your own customized version of the <<list-links>> macro, use the <$list> widget, like this:

<$list filter="[tag[tagName]]">
   <$link />
   <div style="height:0.5em;"></div>
</$list> 

Notes:
* The filter syntax is the same as used in the macro
* Within the $list widget, the matching tiddler title is available as <<currentTiddler>>
* $link widget with no params defaults to creating a link to the <<currentTiddler>>
* The <div style="..."></div> is standard HTML and CSS syntax for creating a blank spacer line of the specified height

-e

teo...@gmail.com

unread,
Nov 15, 2020, 8:49:47 AM11/15/20
to TiddlyWiki
Thanks, that works.  I added the <div style="..."></div> line directly to $:/core/macros/list, whose first code block now begins like this (if it matters, the version is 5.1.23-prerelease):

\define list-links(filter,type:"ul",subtype:"li",class:"",emptyMessage)
\whitespace trim
<$type$ class="$class$">
<$list filter="$filter$" emptyMessage=<<__emptyMessage__>>>
<$subtype$>
<$link to={{!!title}}>
<$transclude field="caption">
<$view field="title"/>
</$transclude>
</$link>
<div style="height:1em;"></div>
</$subtype$>
</$list>
</$type$>
\end

This had my intended visual effect automatically throughout the wiki, so I'm happy with that!

But is it bad practice to directly edit a core Tiddler like this macro, and not indicate anywhere in my wiki that I've done so?
Or is this fine, supposing that I remember to take this edit into account when updating the version of my wiki?

Eric Shulman

unread,
Nov 15, 2020, 10:14:09 AM11/15/20
to TiddlyWiki
On Sunday, November 15, 2020 at 5:49:47 AM UTC-8 teo...@gmail.com wrote:
Thanks, that works.  I added the <div style="..."></div> line directly to $:/core/macros/list, whose first code block now begins like this (if it matters, the version is 5.1.23-prerelease):
...
But is it bad practice to directly edit a core Tiddler like this macro, and not indicate anywhere in my wiki that I've done so?
Or is this fine, supposing that I remember to take this edit into account when updating the version of my wiki?

In general, it is considered bad practice to modify core tiddlers for two reasons:
  1. When updating the version of your wiki, the modified core tiddler won't be updated unless, as you noted, you remember it's been modified and then manually update it yourself.
  2. If you share any of your content with someone else, their wiki won't have the same modified core tiddler, unless you also remember to share that tiddler too; and then, it may have an unwanted side-effect on other content in the receiving wiki.
Instead, I suggest cloning the core tiddler -- e.g., to $:/teo/macros/list -- and then rename the cloned macro -- e.g. \define teo-list-links()
In this way, you don't have to worry about updates or side-effects when sharing.

-e

teo...@gmail.com

unread,
Nov 15, 2020, 2:29:36 PM11/15/20
to TiddlyWiki
Thanks for the general good practice and suggestion; noted! :)

Teo

Reply all
Reply to author
Forward
0 new messages