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/dab6402f-579d-47a6-8a80-a14ea6fa7e1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to