Support for macros and code snippits in macro calls or just Clone a Widget?

33 views
Skip to first unread message

TonyM

unread,
Oct 11, 2018, 9:37:05 PM10/11/18
to TiddlyWikiDev
Folks,

I would like to clone the macrocall widget and provide the same functionality inside a widget named <$m to use the macrocall is there some simple instructions I can follow to do so from someone familiar with widget creations?

<$m $name=if condition="[go[yes]]" then=<<action-yes>> else=<<action-no>> />

Ideally the first parameter would be assumed to be $name rather than specifying it as such with $name="macroname"

<$m if condition="[go[yes]]" then=<<action-yes>> else=<<action-no>> />

and in my dreams it would be nice if I could reference a macro as if it were a widget or using some other syntax even further

Such as
<!-- as if widget -->

<$if condition="[go[yes]]" then=<
<action-yes>> else=<<action-no>> />


<!-- as if widget --><!-- implied positions -->

<$if "[go[yes]]" <
<action-yes>> <<action-no>> />

<!-- implied positions -->
<$m if "[go[yes]]" <
<action-yes>> <<action-no>> />


<!-- If must be different syntax? -->
 

<#if "[go[yes]]" <
<action-yes>> <<action-no>> />

The key here is I want to be able to make much more readable code as a result of my own macro definitions being usable more clearly and with other macros providing input values.

Along with filters such as fieldname[value] I could build my own "language" components on which to write Wikitext and macros.

Regards
Tony
Reply all
Reply to author
Forward
0 new messages