On 08/11/11 11:51, Lex Trotman wrote:
On Tue, Nov 8, 2011 at 9:22 AM, Stuart Rackham<[email protected]> wrote:
On 08/11/11 10:44, Lex Trotman wrote:
[...]
Thanks for the explanatin Lex, the fog is starting to clear :-)
Would something as simple as a {blockname} attribute set to the name of
the
current block ('quote', 'paragraph', 'example', 'sidebar' etc) work?
You could then do:
<text:p text:style-name="{blockname}block">para 1</text:p>
Cheers, Stuart
Setting {blockname} to the CSS class names currently used in xhtml11 and
html5
would be more consistent, the {blockname} could then replace the
hardwired
class
names in xhtml11 and html5 conf files.
This will allow a single nesting block only, but thats similar to the
limitations of docbook. I'd say it is ok for version one.
Would my previous {blockpath} suggestion help here?
http://groups.google.com/group/asciidoc/browse_thread/thread/843d7d3d671006fb/5f3b864bc3a36286?lnk=gst&q=blockpath#5f3b864bc3a36286
Yes, perhaps.
Thinking about the configuration file entry for paragraph, the logic
of the style part needs to be:
if user specified a [style] then
text:style-name={style}
else if {blockname} then
text:style-name={blockname}
else nothing
the first part is clearly {style? text:style-name="{style}"} but how
do I do the elseif part, ie test one attribute not defined and one is
defined? IIUC you can't nest conditional attributes.
This will work:
{style}
{style%}{block}
Do you mean the 'role' (1st positional) block attribute?
e.g. this listing:
[source,c]
--------------------------------------
#include<stdio.h>
--------------------------------------
Has a blockname of 'listingblock' and the role is 'source'
That wasn't what I was thinking about, but it is another factor,
especially as admonitions are example blocks with [NOTE] [IMPORTANT]
etc
So would it make sense to set 3 global attributes?
{blockclass} = 'listingblock'
{blockrole} = 'source'
{blockname} = 'source-listingblock'
Similarly for other roled blocks/paragraphs: verse, quote, literal
Possibly, I was thinking of source
Sorry I was confusing role and style attributes, replace 'role' with 'style' in
above.
................................
[quote]
____
para 1
[some-non-standard-style]
para 2
____
[some-other-style]
and a para that is not nested
and a final para without styles
.................................
Since all the paragraphs go through the one paragraph backend template
it has to use the explicit style (role in docbook) else blockclass
else nothing giving the paragraph elements (ignoring all enclosing
stuff)
<text:p text:style-name="paragraph-quoteblock">para 1</text:p>
<text:p text:style-name="some-non-standard-style">para 2</text:p>
<text:p text:style-name="some-other-style">and a para that is not
nested</text:p>
<text:p>and a final para without styles</text:p>
so what does the backend paragraph template look like?
<text:p text:style-name="{style=}{style!{blockname}-paragraph}">
|
</text:p>
The {blockname} would need to default to 'default' for the outer non-block
level. This will give us the following styles:
8<-----------------------
[quote]
____
para 1 // quoteblock-paragraph
[some-non-standard-style]
para 2 // some-non-standard-style
____
[some-other-style]
and a para that is not nested // some-other-style
and a final para without styles // default-paragraph
8<-----------------------
Cheers, Stuart
Cheers
Lex
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.