My theme for forester (+plugins)
at main 130 lines 3.0 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.forester-notes.org" 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 <xsl:template match="f:figure"> 37 <figure> 38 <xsl:apply-templates /> 39 </figure> 40 </xsl:template> 41 42 <xsl:template match="f:figcaption"> 43 <figcaption> 44 <xsl:apply-templates /> 45 </figcaption> 46 </xsl:template> 47 48 <xsl:template match="f:p"> 49 <p> 50 <xsl:apply-templates /> 51 </p> 52 </xsl:template> 53 54 <xsl:template match="f:code"> 55 <code> 56 <xsl:apply-templates /> 57 </code> 58 </xsl:template> 59 60 <xsl:template match="f:pre"> 61 <pre> 62 <xsl:apply-templates /> 63 </pre> 64 </xsl:template> 65 66 <xsl:template match="f:em"> 67 <em> 68 <xsl:apply-templates /> 69 </em> 70 </xsl:template> 71 72 <xsl:template match="f:strong"> 73 <strong> 74 <xsl:apply-templates /> 75 </strong> 76 </xsl:template> 77 78 <xsl:template match="f:ol"> 79 <ol> 80 <xsl:apply-templates /> 81 </ol> 82 </xsl:template> 83 84 <xsl:template match="f:ul"> 85 <ul> 86 <xsl:apply-templates /> 87 </ul> 88 </xsl:template> 89 90 <xsl:template match="f:li"> 91 <li> 92 <xsl:apply-templates /> 93 </li> 94 </xsl:template> 95 96 <xsl:template match="f:blockquote"> 97 <blockquote> 98 <xsl:apply-templates /> 99 </blockquote> 100 </xsl:template> 101 102 <xsl:template match="f:img[@src]"> 103 <img src="{@src}" /> 104 </xsl:template> 105 106 <xsl:template match="f:error | f:info"> 107 <span class="error"> 108 <xsl:apply-templates /> 109 </span> 110 </xsl:template> 111 112 <xsl:template match="f:info"> 113 <span class="info"> 114 <xsl:apply-templates /> 115 </span> 116 </xsl:template> 117 118 <xsl:template match="f:tex[@display='block']"> 119 <xsl:text>\[</xsl:text> 120 <xsl:value-of select="." /> 121 <xsl:text>\]</xsl:text> 122 </xsl:template> 123 124 <xsl:template match="f:tex[not(@display='block')]"> 125 <xsl:text>\(</xsl:text> 126 <xsl:value-of select="." /> 127 <xsl:text>\)</xsl:text> 128 </xsl:template> 129 130</xsl:stylesheet>