Hi ,
i am trying to make this effect where a
" very very very long title" is shortened and displayed as
" very very very lo…"
to save space.
which operator should i use ?
thank you
Hi ,
i am trying to make this effect where a
" very very very long title" is shortened and displayed as
" very very very lo…"
to save space.
which operator should i use ?
thank you
If you can address the problem using CSS…
@CodaCoder’s answer is the right one, it will probably be way more flexible. however i took it as a challenge, so here’s my macro:
\procedure truncate(length text)
<$let
filter="[<text>split[]prepend[⨷]move:$1$[⨷]allbefore[⨷]join[]]"
sub={{{[<filter>substitute<length>]}}}>
<$text text={{{[subfilter<sub>addsuffix[...]]}}}/>
</$let>
\end
<<truncate 13 "here is a long text that will be truncated">>
gives
here is a lon...
the primary operator i used was allbefore[]
, but because you can’t use a variable in the suffix of a filter operator directly i had to break it out and substitute[]
it in as text before running it with subfilter[]
.
i also used a strange unicode character i found ⨷
as a marker because if the marker is naturally in the tiddler title it will break.
Thanks. But pure wikitext solutions are always welcome
This may be a useful feature in can add to my alt-title solution however the biggest annoyance is catering for the spaces available given the number of buttons and zoom level.
Thanks all,
i used the wikitext solution:)