Your explanation about the "why" completely makes sense. As for creating a custom nestable construct, I'll try to create something and see how it goes. Thanks a lot for your insights and suggestions.
On Tuesday, January 20, 2015 at 12:28:34 PM UTC-2, Lex Trotman wrote: > > On 20 January 2015 at 23:08, Fernando Basso <[email protected] > <javascript:>> wrote: > > Actually, that is what I have been using so far (sorry I didn't mention > it). > > However, my main > > concern is to produce more semantic html, where I really needed some > divs to > > be nested > > inside a "wrapper" div. > > > > Still, this is a usable solution and I'll have no choice but sticking to > it. > > Thanks. > > > > I just wonder why the author of asciidoc never considered (since it also > > generates html) > > that people might want or even need something like that. Is that type of > > situation so > > infrequent that it doesn't even make sense to allow it? Perhaps > openblocks > > could > > have different number of "--" to indicate parent/child relationships. > > Basically no other blocks make sense to nest, eg listings inside > listings?? > > Also remember asciidoc was originally to generate docbook not HTML, > and docbook is much more restrictive on what is legal. For docbook > the open block actually generates no constructs, it just includes > multiple elements within list items which is its original purpose. > > And remember "----" is a listing block delimiter, so adding dashes > can't be used to denote nesting. > > You could create a custom nestable construct for your document only, > but thats not portable to other asciidoc processors. > > Cheers > Lex > > > > > Anyway, thanks a lot for helping. I'm still loving asciidoc so far. > > > > > > On Tuesday, January 20, 2015 at 10:49:59 AM UTC-2, Lex Trotman wrote: > >> > >> On 20 January 2015 at 22:02, Fernando Basso <[email protected]> > wrote: > >> > I need to do something like this: > >> > > >> > [role='exercise'] > >> > -- > >> The above is the start of the first block > >> > [role='question'] > >> > -- > >> The above is the end of the first block > >> > question goes here. > >> > -- > >> The above is the start of the second block > >> > > >> > [role='answer'] > >> > -- > >> The above is the end of the second block > >> > answer goes here. > >> > -- > >> The above is the start of the third block > >> > -- > >> The above is the end of the third block > >> > >> There is no nesting of blocks of the same type possible because the > >> block open syntax is the same as the block close syntax. > >> > >> You will have to use different block types or other constructs if you > >> want to nest. > >> > >> The closest way to get your result is probably > >> > >> [role='ex'] > >> -- > >> introductory blah blah > >> -- > >> [role='q'] > >> -- > >> tough question > >> -- > >> [role='a'] > >> -- > >> expansive answer > >> > >> using several paras > >> -- > >> [role='ex'] > >> -- > >> continued blah blah > >> -- > >> > >> etc > >> > >> and use the css to style 'q' and 'a' the same as 'ex' except for what > >> you wanted different. > >> > >> The difference is only one extra [role='ex'] per exercise. > >> > >> Cheers > >> Lex > >> > >> > > >> > I wanted the output to be something like > >> > > >> > <div class='exercise'> > >> > <div class='question'>Question goes here.</div> > >> > <div class='answer'>Answer goes here.</div> > >> > </div> > >> > > >> > Is something like that possible (I'm only concerned with html5 > backend)? > >> > > >> > -- > >> > You received this message because you are subscribed to the Google > >> > Groups > >> > "asciidoc" 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/asciidoc. > >> > For more options, visit https://groups.google.com/d/optout. > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "asciidoc" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to [email protected] <javascript:>. > > To post to this group, send email to [email protected] > <javascript:>. > > Visit this group at http://groups.google.com/group/asciidoc. > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "asciidoc" 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/asciidoc. For more options, visit https://groups.google.com/d/optout.
