Split a Date, show as text not link?

118 views
Skip to first unread message

amreus

unread,
Aug 26, 2020, 4:08:37 PM8/26/20
to TiddlyWiki

Seems silly because I did this a couiple days ago but can't remember what I did.

Basically I want this {{{[[2020-06-26]split[-]first[]]}}} but the year as text not a link.  The year is coming from a field tho.

tia.

Mat

unread,
Aug 26, 2020, 4:17:40 PM8/26/20
to TiddlyWiki
Check out this issue discussion for a solution and chime in or give things a thumbs up if you agree:


<:-)

Saq Imtiaz

unread,
Aug 26, 2020, 4:19:50 PM8/26/20
to TiddlyWiki
<$text text={{{[[2020-06-26]split[-]first[]]}}} /> 

amreus

unread,
Aug 26, 2020, 5:26:45 PM8/26/20
to TiddlyWiki
Ah cool. Thanks to you both.

I do think there ought to be some sort of shortcut syntax for non-linked text in filtered transclusion.  I wouldn't have a preference yet as to how it might look.

PMario

unread,
Aug 27, 2020, 1:53:30 PM8/27/20
to TiddlyWiki
On Wednesday, August 26, 2020 at 10:08:37 PM UTC+2, amreus wrote:

Seems silly because I did this a couiple days ago but can't remember what I did.

Basically I want this {{{[[2020-06-26]split[-]first[]]}}} but the year as text not a link.  The year is coming from a field tho.

you can do this:

\define tv-wikilinks() no

{{{[[2020-06-26]split[-]first[]]}}}


and use the above in a template. So the define doesn't interfere with other text that may follow.

-mario

Eric Shulman

unread,
Aug 27, 2020, 2:50:57 PM8/27/20
to TiddlyWiki
On Thursday, August 27, 2020 at 10:53:30 AM UTC-7, PMario wrote:
you can do this: 
\define tv-wikilinks() no
{{{[[2020-06-26]split[-]first[]]}}}
and use the above in a template. So the define doesn't interfere with other text that may follow.

You can also limit the effect of tv-wikilinks by using <$vars>...</$vars>, like this:

<$vars tv-wikilinks="no">
{{{[[2020-06-26]split[-]first[]]}}}  THIS IS NOT A LINK
</$vars>
{{{[[2020-06-26]split[-]first[]]}}}  THIS IS A LINK

-e

Mat

unread,
Aug 27, 2020, 4:52:18 PM8/27/20
to TiddlyWiki
Eric Shulman wrote:
You can also limit the effect of tv-wikilinks by using <$vars>...</$vars>, like this:

<$vars tv-wikilinks="no">
{{{[[2020-06-26]split[-]first[]]}}}  THIS IS NOT A LINK
</$vars>

Huh? So... tv-wikilinks is some kind of "environmental variable" to control how other variables behave? Muy interesante. In that docs tiddler it is not quite clear that it can be used this way. Also, I note the docs is tagged "Configuration Variable" but there is no such tiddler so I'm wondering if this "control of other variables" is a common characteristic for all such configuration variables?

<:-)

Eric Shulman

unread,
Aug 27, 2020, 5:07:22 PM8/27/20
to TiddlyWiki
On Thursday, August 27, 2020 at 1:52:18 PM UTC-7, Mat wrote:
Eric Shulman wrote:
You can also limit the effect of tv-wikilinks by using <$vars>...</$vars>, like this:

<$vars tv-wikilinks="no">
{{{[[2020-06-26]split[-]first[]]}}}  THIS IS NOT A LINK
</$vars>

Huh? So... tv-wikilinks is some kind of "environmental variable" to control how other variables behave?

Not exactly.  Most tv-* variables modify the behavior of some *widget*.  In this case, as written in the documentation:

The tv-wikilinks variable controls the behaviour of the $link widget.
 
In that docs tiddler it is not quite clear that it can be used this way. 

The difference between using
\define variablename() ...
and
<$vars variablename="...">
...
</$vars>
is that the \define syntax applies to the whole tiddler in which it occurs, while the <$vars>...</$vars> syntax has more limited scope.

Also, if a tiddler is tagged with "$:/tags/Macro", then the \define syntax will automatically be exported as a global macro, whereas the <$vars>...</$vars> syntax will not.

-e

TW Tones

unread,
Aug 27, 2020, 7:03:24 PM8/27/20
to TiddlyWiki
Amreus, Et Al...

I do think there ought to be some sort of shortcut syntax for non-linked text in filtered transclusion.  I wouldn't have a preference yet as to how it might look.

I totally agree with this, but rather than say "non-linked text". I would say plain text. Its such a fundamental need, the long winded text widget is a pain when reading code.

Just as a suggestion what it triple single quotes delimited it?

'''{{{[[2020-06-26]split[-]first[]]}}}'''

Rather than
<$text text={{{[[2020-06-26]split[-]first[]]}}} /> 

Even nicer if we could
['varname'match[yes]] in filters, wikified and text version of the value of varname returned.

But you can see I would also like a shortform to replace "wikify" to evaluate then return text. Perhaps they could be the same thing?

Tones

PMario

unread,
Aug 28, 2020, 6:54:37 AM8/28/20
to TiddlyWiki
On Friday, August 28, 2020 at 1:03:24 AM UTC+2, TW Tones wrote:
Amreus, Et Al...

I do think there ought to be some sort of shortcut syntax for non-linked text in filtered transclusion.  I wouldn't have a preference yet as to how it might look.

I totally agree with this, but rather than say "non-linked text". I would say plain text. Its such a fundamental need, the long winded text widget is a pain when reading code.

Just as a suggestion what it triple single quotes delimited it?

'''{{{[[2020-06-26]split[-]first[]]}}}'''

There is a discussion at github about this exact problem. Discussion about a possible solution starts here: https://github.com/Jermolene/TiddlyWiki5/issues/4816#issuecomment-673971149 .. .You'll also need to read the following posts from Jeremy.

So there is a chance that we get a fix. .. You may want to +1 your favorites at the github issues page.

-mario

amreus

unread,
Aug 29, 2020, 1:49:53 PM8/29/20
to TiddlyWiki
Excellent discussion and examples. Thanks to everyone who replied.

I wonder why the textwidget requires the text= part if it only has one parameter?  Writing

<$text {{{[[2020-06-26]split[-]first[]]}}}/>

wouldn't be a bad option.
Reply all
Reply to author
Forward
0 new messages