\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$">>\endI 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?
The 80/20 rule is very well illistrated in your comment, especialy raising the outstanding issues. Thanks for sharing that.
I feel it is different if you make reusable components. Thus making something reusable may require 20% more effort thus 120% is required for the first, however the second use may demand 50% of the effort of creating again and subsequent uses, perhaps as low as 2% of the original effort.
For this reason most of what I do in tiddlywiki is reusable however making macros use almost all variables (in the true sense of the word) is not documented in examples and a bit tricky. Perhaps tiddlywiki reusability demands 200% of the original effort but is more rewarding in reuse.
I hope to share wikitext for reusability tips when I grasp them myself.
Regards
Tony
You will see in my responce to Mario that rather than simplifying code being my main objective is reusability. However I am always simplfying as best I can.
If a macro is easy to use, but is applicable in more cases all the better. This is one form of reusability.
Another form of reusability is code you can copy and refactor into another solution.
And others are reusable code snipits, reusable algorithiums and even ideas.
Regards
Tony
Thank you Tony!