You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Stefan Baramov <St...@trx.com> on 2005/02/11 19:36:48 UTC
Appling CSS class to the source tag in apache doc
May be I am mistaken but the class attribute of "source" tag does not
work in Forrest 0.6 for the "pelt" skin.
I have an xml file defined like this
<source class="my_class">
My pre
formatted
text
</source>
This always will result in
<pre class="code">
My pre
formatted
text
</pre>
Notice, that instead of "my_class" the "code" class is used. My question
is why? Is this skin specific? Or a bug?
The "my_class" is defined in the skinconf.xml of the project in the
<extra-css> section.
Thanks,
Stefan Baramov
Re: Appling CSS class to the source tag in apache doc
Posted by Johannes Schaefer <jo...@uidesign.de>.
> <xsl:apply-templates select="@class"/>, code
shouldn't it be without the comma?
> <xsl:apply-templates select="@class"/> code
at least like this I can set attributes for the
original class-attribute and "code" with firefox:
pre.code {...}
pre.whatever {...}
Maybe this is browser-dependent?
Cheers,
Johannes
Ross Gardler wrote:
> Stefan Baramov wrote:
>
>> May be I am mistaken but the class attribute of "source" tag does not
>> work in Forrest 0.6 for the "pelt" skin.
>> I have an xml file defined like this
>>
>> <source class="my_class">
>> My pre
>> formatted text
>> </source>
>>
>> This always will result in
>> <pre class="code">
>> My pre
>> formatted text
>> </pre>
>>
>> Notice, that instead of "my_class" the "code" class is used. My question
>> is why? Is this skin specific? Or a bug?
>
>
> The source tag has a specific meaning hence the class="code" attribute.
> However, the skin should really allow the user to pass class information
> in the way you illustrate in order to allow custom styling. I would
> consider this a bug, please file a bug report.
>
> I think a solution is to change the following in
> main/webapp/skins/common/html/document2html.xsl:
>
> <xsl:template match="source">
> <xsl:apply-templates select="@id"/>
> <pre class="code">
>
> to:
>
> <xsl:template match="source">
> <xsl:apply-templates select="@id"/>
> <pre>
> <xsl:attribute name="class">
> <xsl:apply-templates select="@class"/>, code
> </xsl:attribute>
>
> Please test it and let us know if this works.
>
> Ross
>
>
>
--
User Interface Design GmbH * Teinacher Str. 38 * D-71634
Ludwigsburg
Fon +49 (0)7141 377 000 * Fax +49 (0)7141 377 00-99
Geschäftsstelle: User Interface Design GmbH *
Lehrer-Götz-Weg 11 * D-81825 München
www.uidesign.de
Buch "User Interface Tuning" von Joachim Machate & Michael
Burmester
www.user-interface-tuning.de
Besuchen Sie uns auf der Hannover Messe 11.-15. April 2005
Halle 2, Stand C14 auf dem MMI Gemeinschaftsstand
www.uidesign.de/hmi2005
Nächstes TAE-Seminar zu User Interface Design
Ostfildern-Nellingen, 07.-08. April 2005
www.tae.de TAE-Veranstaltung Nr. 31189
Re: Appling CSS class to the source tag in apache doc
Posted by Ross Gardler <rg...@apache.org>.
Stefan Baramov wrote:
> May be I am mistaken but the class attribute of "source" tag does not
> work in Forrest 0.6 for the "pelt" skin.
>
> I have an xml file defined like this
>
> <source class="my_class">
> My pre
> formatted
> text
> </source>
>
> This always will result in
>
> <pre class="code">
> My pre
> formatted
> text
> </pre>
>
> Notice, that instead of "my_class" the "code" class is used. My question
> is why? Is this skin specific? Or a bug?
The source tag has a specific meaning hence the class="code" attribute.
However, the skin should really allow the user to pass class information
in the way you illustrate in order to allow custom styling. I would
consider this a bug, please file a bug report.
I think a solution is to change the following in
main/webapp/skins/common/html/document2html.xsl:
<xsl:template match="source">
<xsl:apply-templates select="@id"/>
<pre class="code">
to:
<xsl:template match="source">
<xsl:apply-templates select="@id"/>
<pre>
<xsl:attribute name="class">
<xsl:apply-templates select="@class"/>, code
</xsl:attribute>
Please test it and let us know if this works.
Ross
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 10/02/2005