On Sat, May 15, 2021 at 2:24 PM Odin <[email protected]> wrote:

> Thank you Saq for the solutions!! Helps a lot : )
>
> @Mohammed, I did try a search in the TW-scripts. So I think I will add a
> pull request to include Saq's solutions soon!
>

Thank you Odin! also feel free to email me the tiddlers if you like!

>
> Op zaterdag 15 mei 2021 om 11:46:45 UTC+2 schreef Anjar:
>
>> Hi,
>>
>> This would be very easy if we had a general way to hard-replace macros at
>> tiddler save; see https://groups.google.com/g/tiddlywiki/c/crnjiJ4Spq4 (I'm
>> mentioning it here since google groups doesn't show backlinks..)
>>
>> Best,
>> Anders
>>
>> lørdag 15. mai 2021 kl. 11:41:31 UTC+2 skrev [email protected]:
>>
>>> Below are three different ways to do this using reduce and without
>>> wikify. The last one uses a custom filter printf[] that is attached.
>>> Note that you can use a tiddler for your template as well.
>>>
>>> *#1 - addprefix galore*
>>>
>>> <$button> save to a single tiddler
>>> <$vars lb="
>>> ">
>>> <$action-setfield $tiddler="report" text={{{ [tag[About]]
>>> :reduce[get[text]addprefix<lb>addprefix<lb>addprefix{!!title}addprefix[!!]addprefix<lb>addprefix<accumulator>]
>>> }}}/>
>>> </$vars>
>>> </$button>
>>>
>>> *#2 - search-replace*
>>>
>>> <$button> save to a single tiddler
>>> <$vars template="
>>> !! _TITLE_
>>>
>>> _TEXT_
>>> ">
>>> <$action-setfield $tiddler="report" text={{{ [tag[About]]
>>> :reduce[<template>search-replace:gi[_TITLE_],{!!title}search-replace[_TEXT_],{!!text}addprefix<accumulator>]
>>> }}}/>
>>> </$vars>
>>> </$button>
>>>
>>> *#3 - printf[]*
>>>
>>> <$button> save to a single tiddler
>>> <$vars template="
>>> !! $0$
>>>
>>> $1$
>>> ">
>>> <$action-setfield $tiddler="report" text={{{ [tag[About]]
>>> :reduce[<template>printf{!!title},{!!text}addprefix<accumulator>] }}}/>
>>> </$vars>
>>> </$button>
>>>
>> --
> 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/d6e97852-c71c-4298-8654-616c0d441898n%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/d6e97852-c71c-4298-8654-616c0d441898n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAAV1gMCL0eFOgnfhb%3DTftvHujG_KPVULGxzoQY3EG4dgKiTUUg%40mail.gmail.com.

Reply via email to