Folks,

\define pipe() |

use <pipe> in filters

addprefix<pipe>addprefix[hi]

Regards
Tones

On Thursday, 22 April 2021 at 09:45:09 UTC+10 Álvaro wrote:

> I don't understand some things in your macro.
>
> Why are you using two different methods to create the links?
>
>
> I am using something like the following snippet, but i use it with two 
> "basic" macros. Maybe you can use the idea of snippet in your context.
>
> \define basic-macro(z) x5 y3 $z$
>
> \define complex-macro(x, y)
> \whitespace trim 
> <$set name="result" filter=" [<__y__>!match[]]" 
>         value="""<$macrocall $name="basic-macro" z=<<__x__>> />""" 
>         emptyValue="""<$macrocall $name="basic-macro" />""" > 
>     <<result>>
> </$set> 
> \end
>
>
> Examples:
>
> `<<complex-macro Z>>`=><<complex-macro Z>>
>
> `<<complex-macro Z test>>`=><<complex-macro Z test>> 
>
> Maybe you don't need use macrocall widget and you can use basic macro call 
> <<basic-macro 
> $x$ $y$>> . It depends if you need call the parameters as variables or if 
> it is enought the text sustitution of the parameter. Also in the filter you 
> could use it the text sustitution, in the snippet [[$y$]!match[]]
> El martes, 20 de abril de 2021 a las 15:15:26 UTC+2, Mat escribió:
>
>> Thanks Alvaro. For some reason I don't get that to work in my context, 
>> i.e:  https://link-or-ext.tiddlyhost.com/
>>
>> The workaround I use there is bad but maybe it'll have to do (breifly; 
>> the user has to himself suffix the pipe character to the pretty title in 
>> the macro call) 
>>
>> Thanks.
>>
>> <:-)
>>
>> On Tuesday, April 20, 2021 at 2:48:11 PM UTC+2 Álvaro wrote:
>>
>>> You can use a variable for pipe.
>>>
>>> This works
>>> <$vars l="[[" r="]]" x="|">{{{ hi HelloThere 
>>> +[join<x>addprefix<l>addsuffix<r>] }}}</$vars>
>>> El martes, 20 de abril de 2021 a las 14:18:13 UTC+2, Mat escribió:
>>>
>>>> I want to create a pretty title link in a filter. Unfortunately the 
>>>> pipe character in hi| breaks the filter (ref1 
>>>> <https://github.com/Jermolene/TiddlyWiki5/issues/4462>).
>>>>
>>>> E.g these attempts no worky:
>>>>
>>>> <$vars l="[[" r="]]">{{{ HelloThere 
>>>> +[addprefix[hi*|*]addprefix[l]addsuffix[r]] 
>>>> }}}</$vars>
>>>>
>>>> <$vars l="[[" r="]]">{{{ hi HelloThere 
>>>> +[join[*|*]addprefix[l]addsuffix[r]] 
>>>> }}}</$vars>
>>>>
>>>> Any ideas what to do? Maybe some magic regepx is needed but I don't 
>>>> know how to construct it in that case...
>>>>
>>>> <:-)
>>>>
>>>> ...Hm, that's like my fourth question today and I didn't even have 
>>>> lunch yet. I have no idea why they all mount up at the same time. I 
>>>> typically tiddle fiddle for days without questions.
>>>>
>>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/149e0c66-8486-4191-bbf6-b57c6442d257n%40googlegroups.com.

Reply via email to