I've added global 'blockname' attribute that is dynamically updated to the
current block short name. Applies to delimited blocks, lists and
tables.

http://code.google.com/p/asciidoc/source/detail?r=08d77b0075c5a4075d3167850afc4b3a41cc6fdd

To see what's going on run asciidoc with a block trace e.g.

  asciidoc -a trace=block t.txt

The ``short name'' is the text following the last dash in the conf
file definition section name e.g. the quote delimited block is defined
in the [blockdef-quote] section so the short name is 'quote'. The
short name for tables is 'table'.

So hopefully templates like:

<text:p
text:style-name="{style}"
text:style-name="{style%}{blockname}-paragraph"
>
|
</text:p>

will work.


Cheers, Stuart


On 08/11/11 13:57, Lex Trotman wrote:
[...]
This will work:

{style}
{style%}{block}


Of course, I have gotten out of the habit of thnking about multi-line
solutions because odf converts newlines to whitespace, but inside tags
it shouldn't matter.


[...]
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<-----------------------


Well, I was trying to pick up the default text style if something is
unmarked, but I suppose if there is no way other than having an
explicit default then we will have to.  We will have to be careful to
apply it to anything else where it is needed though.

My head hurts from thinking about it, so I guess this needs to be
tried out in real life now :)

Cheers
Lex


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.




--
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.

Reply via email to