My theme for forester (+plugins)
at d095938b1ecadc0ac776b0b4794dea01656d6944 134 lines 3.1 kB view raw
1<?xml version="1.0"?> 2<!-- SPDX-License-Identifier: CC0-1.0 --> 3<xsl:stylesheet version="1.0" 4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 5 xmlns:f="http://www.jonmsterling.com/jms-005P.xml" 6 xmlns:mml="http://www.w3.org/1998/Math/MathML" 7 xmlns:html="http://www.w3.org/1999/xhtml"> 8 9 <!-- The following ensures that node not matched by a template will show up as an error. --> 10 <xsl:template match="node()|@*"> 11 <xsl:copy> 12 <span style="background-color:red"> 13 <xsl:text>[</xsl:text> 14 <xsl:value-of select="name(.)" /> 15 <xsl:text>]</xsl:text> 16 </span> 17 <span style="background-color:red"> 18 <xsl:apply-templates select="node()|@*" /> 19 </span> 20 </xsl:copy> 21 </xsl:template> 22 23 <!-- HTML and MathML nodes should be copied with namespace prefixes stripped.--> 24 <xsl:template match="html:*"> 25 <xsl:element namespace="http://www.w3.org/1999/xhtml" name="{local-name()}"> 26 <xsl:apply-templates select="@* | node()" /> 27 </xsl:element> 28 </xsl:template> 29 30 <xsl:template match="mml:*"> 31 <xsl:element namespace="http://www.w3.org/1998/Math/MathML" name="{local-name()}"> 32 <xsl:apply-templates select="@* | node()" /> 33 </xsl:element> 34 </xsl:template> 35 36 37 <xsl:template match="f:figure"> 38 <figure> 39 <xsl:apply-templates /> 40 </figure> 41 </xsl:template> 42 43 <xsl:template match="f:figcaption"> 44 <figcaption> 45 <xsl:apply-templates /> 46 </figcaption> 47 </xsl:template> 48 49 <xsl:template match="f:p"> 50 <p> 51 <xsl:apply-templates /> 52 </p> 53 </xsl:template> 54 55 <xsl:template match="f:code"> 56 <code> 57 <xsl:apply-templates /> 58 </code> 59 </xsl:template> 60 61 <xsl:template match="f:pre"> 62 <pre> 63 <xsl:apply-templates /> 64 </pre> 65 </xsl:template> 66 67 <xsl:template match="f:em"> 68 <em> 69 <xsl:apply-templates /> 70 </em> 71 </xsl:template> 72 73 <xsl:template match="f:strong"> 74 <strong> 75 <xsl:apply-templates /> 76 </strong> 77 </xsl:template> 78 79 <xsl:template match="f:ol"> 80 <ol> 81 <xsl:apply-templates /> 82 </ol> 83 </xsl:template> 84 85 <xsl:template match="f:ul"> 86 <ul> 87 <xsl:apply-templates /> 88 </ul> 89 </xsl:template> 90 91 <xsl:template match="f:li"> 92 <li> 93 <xsl:apply-templates /> 94 </li> 95 </xsl:template> 96 97 <xsl:template match="f:blockquote"> 98 <blockquote> 99 <xsl:apply-templates /> 100 </blockquote> 101 </xsl:template> 102 103 104 <xsl:template match="f:embedded-tex"> 105 <img src="resources/{@hash}.svg" /> 106 </xsl:template> 107 108 <xsl:template match="f:error | f:info"> 109 <span class="error"> 110 <xsl:apply-templates /> 111 </span> 112 </xsl:template> 113 114 <xsl:template match="f:info"> 115 <span class="info"> 116 <xsl:apply-templates /> 117 </span> 118 </xsl:template> 119 120 121 122 <xsl:template match="f:tex[@display='block']"> 123 <xsl:text>\[</xsl:text> 124 <xsl:value-of select="." /> 125 <xsl:text>\]</xsl:text> 126 </xsl:template> 127 128 <xsl:template match="f:tex[not(@display='block')]"> 129 <xsl:text>\(</xsl:text> 130 <xsl:value-of select="." /> 131 <xsl:text>\)</xsl:text> 132 </xsl:template> 133 134</xsl:stylesheet>