Hi Stephan As things stand it wouldn't be possible for a bit of wikitext syntax to modify the attributes of parent nodes in the widget render tree.
It sounds like the best solution for your immediate problem would be a simpler syntax for: <div class="english"> some english another para </div> As it happens, the existing @@ is running into problems, as I've noted elsewhere. It now ends up frequently applying its class attributes to widgets that don't have anywhere to put it. So, I'm thinking that it would make sense to modify the @@ syntax so that it generates a div or span to carry the specified class. As you note, this still means that we need a decent syntax for applying a class to the OL or UL of a list. I'd wondered using double dots, for example: *..myListClass * ListItem 1 *.myListItemClass ListItem 2 Which would generate: <ul class="myListClass"> <li>ListItem 1</li> <li class="myListItemClass">List Item 2</li> </ul> What do you think? Best wishes Jeremy On Fri, Nov 22, 2013 at 8:13 AM, Stephan Hradek <[email protected]>wrote: > Currently we have > > @@.classname > somestuff > > some more stuff > @@ > > which applies the class "classname" to each child object. So both > paragraphs in this case will look like > > <p class="classname">… > > What about extending it to > > @@@.classname > somestuff > > some more stuff > @@@ > > Where the classname would be applied to a common parent object? > > At the moment I'm not sure whether I would like it to a newly to be > created <div> or to a common parent object the objects already have. You > see: > > @@.classname > # item1 > # item2 > @@ > > generates at the moment > <ol> > <li class="classname>item1</li> > <li class="classname>item2</li> > </ol> > where we have the common parent <ol> while in the paragraph example there > is no one-parent object and we might need a <div>. > > The reason why I'm asking: This syntax is just here for CSS purposes. This > new approach would help me a lot. > > Example: In my current task I have this: > > @@.english > some english text > @@ > > @@.german > etwas deutscher Text > @@ > > With my CSS I put a flag in front of each "english" and "german" > paragraph. But what I'd like to be able to do is to put a flag just before > the first paragraph of a given language, so that > > @@.english > some english text > > another english paragraph > @@ > > @@.german > etwas deutscher Text > > ein anderer deutscher Absatz > @@ > > Would not show 4 flags but just 2. > > Unfortunately my first attempt with "p.english:first-child" and > "p:german:first-child" did only work for (in this example) english as that > is <p> is the first child of its parent. The first german sentence is the > third child. > > Would we have a surrounding <div> here, I could have done: > > div:english > p:first-child > and > div:german > p:first-child > > to just flag the first paragraphs. > > -- > 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. > For more options, visit https://groups.google.com/groups/opt_out. > -- Jeremy Ruston mailto:[email protected] -- 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. For more options, visit https://groups.google.com/groups/opt_out.
