I'm not sure what you mean by "shortest". You could define each macro in 
it's own tiddler, and then have one macro that uses any of them, passing a 
selector string to indicate which one to use, perhaps.

-- Mark

On Tuesday, August 21, 2018 at 6:10:13 AM UTC-7, Mohammad wrote:
>
> I have developed several macros for creating alerts! The difference among 
> them is  only the classes.
> What is the shortest solution to implement these macros in Tiddlywiki?
>
>
> I have used the below approach: A general macro and call it for specific 
> purpose from another macro!
>
>
> \define __myclsl(type) alert $type$
>
> \define alert(text:"", type:"alert-primary", width:"100%")
> <div class=<<__myclsl $type$>> style="width:$width$;">
> $text$
> </div>
> \end
>
> \define alert-primary(text, width:"100%")
> <div class="alert alert-primary" style="width:$width$;">
> $text$
> </div>
> \end
>
> \define alert-secondary(text, width:"100%")
> <<alert text:"$text$" type:"alert-secondary" width:"$width$">>
> \end
>
> \define alert-success(text, width:"100%")
> <<alert text:"$text$" type:"alert-success" width:"$width$">>
> \end
>
> \define alert-danger(text, width:"100%")
> <<alert text:"$text$" type:"alert-danger" width:"$width$">>
> \end
>
> \define alert-warning(text, width:"100%")
> <<alert text:"$text$" type:"alert-warning" width:"$width$">>
> \end
>
>
> *Mohammad*
>
>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f9371944-0a36-4a33-b05c-b01566ca0303%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to