开发者

How to use custom syntax highlighter styles in DocBook 5.0

开发者 https://www.devze.com 2023-02-04 07:12 出处:网络
I have syntax highlighting on a docbook using a custom language highlighter based on 开发者_如何学Gothe c++ example.

I have syntax highlighting on a docbook using a custom language highlighter based on 开发者_如何学Gothe c++ example.

How can I use different styles for the same highlighter type?

for instance:

<highlighter type="keywords">

<keyword>char</keyword>

<keyword>const</keyword>

<keyword>double</keyword>

<keyword>true</keyword>
<style>keyword</style>

</highlighter>

<highlighter type="keywords">

<keyword>Hotspot</keyword>

<keyword>Character</keyword>

<keyword>Region</keyword>
<style>class</style>

the second load of keywords should highlight with the style 'class' but how do I define and test for this non-default style?


Solved:

 <xsl:template match='xslthl:class' mode="xslthl">
 <b style="color: green"><xsl:apply-templates/></b>
 </xsl:template>

the 'mode' attribute seems vital

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号