OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Elements for presenting multiple language variants in a code example


I'm trying to design a set of elements that I can render as a single
code example with multiple programming language variants. I'd like to
style this in HTML so that the example selectively hides all but one
example variant.

I need to pass some indication of the programming language to the
output HTML so that the styling can select one or another variant. For
example, a <div class="informalexample java"> element could be
distinguished from a <div class="informalexample python"> element.

The elements I'm using so far:

- example
    - title
    - informalexample
        @role = java
        - programlisting
        - calloutlist
    - informalexample
        @role = python
        - programlisting
        - calloutlist

By default, the role attributes on the informalexample elements are
not passed through to the div elements for the informalexamples.

I could customize the template for informalexample to do what I need,
but I'm wondering if there's a build-in way to do this.

Has anyone found a good way to present multiple variants of an example
and offer readers a choice in the output presentation?

Thanks!

Peter


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]