Thank you PMario! How would this compare to the @@ benefits that Eric lists, i.e:
[the @@ syntax supports] @@.class.class.class ...@@ and > @@attr:value;attr:value;...@@ > ... > content inside the @@..@@ block can be *any* wiki text -- including > macros. > ... > nest the @@...@@ syntax > Thank you. FYI, your post has made me look closer at macros thinking I might just manage to learn how to use these! <:-) On Sunday, April 12, 2015 at 12:44:35 PM UTC+2, PMario wrote: > > 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 macro calls 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/d4bbf62b-4f6f-4b28-a1e8-f39dbe33f935%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
