Am 19.06.2012 10:09, schrieb Lex Trotman:
On 19 June 2012 17:25, Wilhelm Meier<[email protected]>  wrote:
Am 19.06.2012 05:57, schrieb Lex Trotman:

On 19 June 2012 13:47, Wilhelm Meier<[email protected]>    wrote:

Hi all,

I would like to have the possibility to distinguish different types of
listings blocks, say one style for shell-language rsp. shell-commands
typed
in and another style for C++ source-code examples. A simple example would
be
to give the shell-language a light-red background and the C++ source a
lightgrey background.

So, the question is: is the a possibility to give additional attributes
to a
listing-block that are passed (uninterpreted) to the backend, so the e.g.
xslt-processor can use them?


Hi,

Thats what the role attribute is for, is made into a role=attribute on
docbook or class= on xhtml


Well, I can't get it working ... no role attribute showed up in the xml
file.

What's wrong?

[source,java,unnumbered,role=xyz]
----
{
        Anweisung-1
}
----

[source,java,unnumbered,4,role=xyz]
----
{
        Anweisung-1
}
----


The "source" style sends it to the source filter, which doesn't
properly use the role attribute for listings without a title.  That'd
be a bug :)

Just tried:

["source","java","unnumbered",args="role=\"xyz\""]
----
----

and got the role-attribute in the xml (with or without title for the block)




I presume you want to keep the source style so your html uses the
source filter to get a programlisting element (non-source styles
listings get a screen element)

Until the bug is fixed you can copy the:

ifdef::basebackend-docbook[]
[source-highlight-block]
...
endif::basebackend-docbook[]

section from source-highlight-filter.conf to a local asciidoc.conf and
add {role? role="{role}"} to the programlisting line.

Havn't tried it but that should do it.

Cheers
Lex


Cheers
Lex


--
Wilhelm

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




--
Wilhelm

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




--
Wilhelm

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