]> git.draconx.ca Git - homepage.git/blob - layouts/gpl.xsl
Put some actual material on the site.
[homepage.git] / layouts / gpl.xsl
1 <?xml version='1.0' encoding='UTF-8' ?>
2 <!--
3   Nick's web site: GNU license reformatter.
4
5   This tool implements any fixes required to ensure the GNU licenses are
6   formatted correctly for the web site.  Since the license sources are
7   originally in markdown format very little post-processing is required.
8
9   Copyright © 2019 Nick Bowler
10
11   This program is free software: you can redistribute it and/or modify
12   it under the terms of the GNU General Public License as published by
13   the Free Software Foundation, either version 3 of the License, or
14   (at your option) any later version.
15
16   This program is distributed in the hope that it will be useful,
17   but WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   GNU General Public License for more details.
20
21   You should have received a copy of the GNU General Public License
22   along with this program.  If not, see <https://www.gnu.org/licenses/>
23 -->
24 <xsl:stylesheet version='1.0'
25   xmlns='http://www.w3.org/1999/xhtml'
26   xmlns:xhtml='http://www.w3.org/1999/xhtml'
27   xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
28   exclude-result-prefixes='xhtml'>
29 <xsl:output method='xml' encoding='UTF-8'
30   omit-xml-declaration='yes' indent='no' />
31
32 <xsl:template match='node()|@*'>
33   <xsl:copy><xsl:apply-templates select='node()|@*' /></xsl:copy>
34 </xsl:template>
35
36 <xsl:template match='//xhtml:h2[1]' />
37
38 <xsl:template match='xhtml:ul'>
39   <xsl:copy>
40     <xsl:attribute name='class'>ordered</xsl:attribute>
41     <xsl:apply-templates select='node()|@*' />
42   </xsl:copy>
43 </xsl:template>
44
45 <xsl:template match='xhtml:li'>
46   <xsl:copy>
47     <xsl:apply-templates select='@*' />
48     <p><xsl:apply-templates select='node()' /></p>
49   </xsl:copy>
50 </xsl:template>
51
52 <xsl:template match='xhtml:li/node()[1][self::text()]'>
53   <xsl:variable name='text' select='normalize-space(.)' />
54   <span><xsl:value-of select='substring-before($text, " ")' />&#xa0;</span>
55   <xsl:value-of select='substring-after($text, " ")' />
56 </xsl:template>
57
58 </xsl:stylesheet>