forked from vert-x/vert-x.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
addstyles.xsl
32 lines (25 loc) · 838 Bytes
/
addstyles.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<!-- Markdown doesn't let you insert a line break after a header :( so
we do this in the stylesheet -->
<xsl:template match="h1|h2|h3|h4|h5|h6">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
<br/>
</xsl:template>
<!-- remove any code elements nested in pre elements since Twitter Bootstrap
requires just pre elements. Also add a prettyprint class to the pre -->
<xsl:template match="pre/code">
<xsl:attribute name="class">prettyprint</xsl:attribute>
<xsl:apply-templates/>
</xsl:template>
<!-- catch all -->
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>