On Sunday, April 12, 2015 at 1:15:58 AM UTC+2, Mat wrote: > > Most widgets have a class="" attribute. So if you want to have macros >> with a class, just define it as a parameter. >> >> macro call <<macroName class:"myClass">> ... done. .. no new syntax >> needed. It's already in the core :) >> > > My point wasn't really about applying a class to widgets but to replace > the @@ syntax. >
There is no need to replace anything. TW wikitext supports html so <div class="myClass">My text comes here</div> is very similar to your proposal and is valid HTML code. While the proposal would need to change some core elements. The above example just works. My first macro suggestion would look like this: \define myMacro(text, class, el:"div") <$el$ class="$class$">$text$</$el$> \end <<myMacro "some text" class:".myClass">> or <<myMacro "some text" class:".myClass" el:"span">> You can use the development tools, to see the html structure that's created. If you want ".myClass" to be default the macro code would look like this: \define myMacro(text, class:".myClass", el:"div") <$el$ class="$class$">$text$</$el$> \end So the call looks like this <<myMacro "some text">> Macros are the way to define your own application specific "syntax". You can make macros as simple as you want. But all of this is just using the existing possibilities. have fun! mario -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" 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 http://groups.google.com/group/tiddlywikidev. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/0563f2d6-e1bc-49ec-a991-c0102c8a5e9f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
