/[gentoo]/xml/htdocs/xsl/guidexml2wiki.xsl
Gentoo

Diff of /xml/htdocs/xsl/guidexml2wiki.xsl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.3
20<xsl:if test="//guide/author[not(@title='script generated')]"> 20<xsl:if test="//guide/author[not(@title='script generated')]">
21== Acknowledgements == 21== Acknowledgements ==
22 22
23We would like to thank the following authors and editors for their contributions to this guide: 23We would like to thank the following authors and editors for their contributions to this guide:
24<xsl:for-each select="//guide/author"> 24<xsl:for-each select="//guide/author">
25* <xsl:value-of select="mail" /> 25* <xsl:choose><xsl:when test="mail/text()"><xsl:value-of select="mail" /></xsl:when><xsl:otherwise><xsl:value-of select="mail/@link" /></xsl:otherwise></xsl:choose>
26</xsl:for-each> 26</xsl:for-each>
27</xsl:if> 27</xsl:if>
28 28
29[[Category:Server and Security]] 29[[Category:Server and Security]]
30</xsl:template> 30</xsl:template>
32<xsl:template match="author" /> 32<xsl:template match="author" />
33 33
34<xsl:template match="abstract" /> 34<xsl:template match="abstract" />
35 35
36<xsl:template match="chapter"> 36<xsl:template match="chapter">
37 37<!-- Ignore developers and subprojects as these will be provided by the wiki itself. -->
38<xsl:if test="not(title='Developers') and not(title='Subprojects')">
38== <xsl:value-of select="title" /> ==<xsl:text> 39== <xsl:value-of select="title" /> ==<xsl:text>
39
40</xsl:text> 40</xsl:text>
41<xsl:apply-templates /> 41<xsl:apply-templates />
42</xsl:if>
42</xsl:template> 43</xsl:template>
43 44
44<xsl:template match="section"> 45<xsl:template match="section">
45<xsl:if test="preceding-sibling::section"><xsl:text> 46<xsl:if test="preceding-sibling::section"><xsl:text>
46</xsl:text> 47</xsl:text>
58 i is for in-pre commands, we cannot support that easily as we have no 59 i is for in-pre commands, we cannot support that easily as we have no
59 knowledge of what needs to be RootCmd, UserCmd, what is output, etc. 60 knowledge of what needs to be RootCmd, UserCmd, what is output, etc.
60--> 61-->
61<xsl:template match="i"><xsl:apply-templates /></xsl:template> 62<xsl:template match="i"><xsl:apply-templates /></xsl:template>
62 63
63<xsl:template match="mail"><xsl:choose><xsl:when test="link">{{Mail|<xsl:value-of select="@link" />|<xsl:value-of select="text()" />}}</xsl:when><xsl:otherwise>{{Mail|<xsl:value-of select="text()" />}}</xsl:otherwise></xsl:choose></xsl:template> 64<xsl:template match="mail"><xsl:text> </xsl:text><xsl:choose><xsl:when test="link">{{Mail|<xsl:value-of select="@link" />|<xsl:value-of select="normalize-space()" />}}</xsl:when><xsl:otherwise>{{Mail|<xsl:value-of select="normalize-space()" />}}</xsl:otherwise></xsl:choose></xsl:template>
64 65
65<xsl:template match="p"><xsl:apply-templates /><xsl:text> 66<xsl:template match="p"><xsl:apply-templates /><xsl:text>
66 67
67</xsl:text> 68</xsl:text>
68</xsl:template> 69</xsl:template>
87 88
88<xsl:template match="uri"><xsl:text> </xsl:text><xsl:choose><xsl:when test="starts-with(@link, 'http')">[<xsl:value-of select="@link" /><xsl:text> </xsl:text><xsl:value-of select="normalize-space(text())" />]</xsl:when><xsl:when test="not(starts-with(@link, '#'))">[http://www.gentoo.org/<xsl:value-of select="@link"/><xsl:text> </xsl:text><xsl:value-of select="normalize-space(text())" />]</xsl:when></xsl:choose><xsl:text> </xsl:text></xsl:template> 89<xsl:template match="uri"><xsl:text> </xsl:text><xsl:choose><xsl:when test="starts-with(@link, 'http')">[<xsl:value-of select="@link" /><xsl:text> </xsl:text><xsl:value-of select="normalize-space(text())" />]</xsl:when><xsl:when test="not(starts-with(@link, '#'))">[http://www.gentoo.org/<xsl:value-of select="@link"/><xsl:text> </xsl:text><xsl:value-of select="normalize-space(text())" />]</xsl:when></xsl:choose><xsl:text> </xsl:text></xsl:template>
89 90
90<xsl:template match="e"> ''<xsl:apply-templates />'' </xsl:template> 91<xsl:template match="e"> ''<xsl:apply-templates />'' </xsl:template>
91 92
92<xsl:template match="ul"> 93<xsl:template match="ul"><xsl:text>
93<xsl:apply-templates /><xsl:text> 94</xsl:text><xsl:apply-templates /><xsl:text>
94</xsl:text> 95</xsl:text>
95</xsl:template> 96</xsl:template>
96 97
97<xsl:template match="ol"> 98<xsl:template match="ol">
98<xsl:apply-templates /></xsl:template> 99<xsl:apply-templates /></xsl:template>
99 100
100<xsl:template match="li"> 101<xsl:template match="li">
101<xsl:choose><xsl:when test="name(..)='ul'">* <xsl:apply-templates /></xsl:when><xsl:when test="name(..)='ol'"># <xsl:apply-templates /></xsl:when><xsl:otherwise>OH NOES HERE IT GOES!</xsl:otherwise></xsl:choose><xsl:text> 102<xsl:choose><xsl:when test="name(..)='ul'"><xsl:for-each select="ancestor::ul|ancestor::ol">*</xsl:for-each><xsl:text> </xsl:text><xsl:apply-templates /></xsl:when><xsl:when test="name(..)='ol'"><xsl:for-each select="ancestor::ol|ancestor::ul">#</xsl:for-each><xsl:text> </xsl:text><xsl:apply-templates /></xsl:when><xsl:otherwise>OH NOES HERE IT GOES!</xsl:otherwise></xsl:choose><xsl:text>
102</xsl:text> 103</xsl:text>
103</xsl:template> 104</xsl:template>
104 105
105<xsl:template match="sup">&lt;sup&gt;<xsl:apply-templates />&lt;/sup&gt;</xsl:template> 106<xsl:template match="sup">&lt;sup&gt;<xsl:apply-templates />&lt;/sup&gt;</xsl:template>
106 107
110 111
111<xsl:template match="date" /> 112<xsl:template match="date" />
112 113
113<xsl:template match="version" /> 114<xsl:template match="version" />
114 115
115<xsl:template match="c"> '''<xsl:apply-templates />''' </xsl:template> 116<xsl:template match="c"> &lt;code&gt;<xsl:apply-templates />&lt;/code&gt; </xsl:template>
116 117
117<xsl:template match="pre"><xsl:text> 118<xsl:template match="pre"><xsl:text>
118</xsl:text> 119</xsl:text>
119<xsl:choose> 120{{GenericCmd|&lt;pre&gt;<xsl:apply-templates />&lt;/pre&gt;
120<xsl:when test="starts-with(normalize-space(), '~$') or starts-with(normalize-space(), '$')">
121{{Cmd|INTERNAL commandhere|output=&lt;pre&gt;
122<xsl:apply-templates />&lt;/pre&gt;
123}} 121}}
124</xsl:when> 122<xsl:text>
125<xsl:when test="starts-with(normalize-space(), '~#') or starts-with(normalize-space(), '#')">
126{{RootCmd|INTERNAL commandhere|output=&lt;pre&gt;
127<xsl:apply-templates />&lt;/pre&gt;
128}}
129</xsl:when>
130<xsl:otherwise>
131{{GenericCmd|&lt;pre&gt;
132<xsl:apply-templates />&lt;/pre&gt;
133}}
134</xsl:otherwise>
135</xsl:choose><xsl:text>
136</xsl:text> 123</xsl:text>
137</xsl:template> 124</xsl:template>
138 125
139<xsl:template match="comment">## <xsl:apply-templates /></xsl:template> 126<xsl:template match="comment">## <xsl:apply-templates /></xsl:template>
140 127
141<xsl:template match="path"> {{Path|<xsl:apply-templates />}} </xsl:template> 128<xsl:template match="path"> {{Path|<xsl:apply-templates />}} </xsl:template>
142 129
143<xsl:template match="b">'''<xsl:apply-templates />'''</xsl:template> 130<xsl:template match="b"><xsl:text> </xsl:text>'''<xsl:apply-templates />'''<xsl:text> </xsl:text></xsl:template>
144 131
145<xsl:template match="warn"> 132<xsl:template match="warn">
146{{Warning|<xsl:apply-templates />}} 133{{Warning|<xsl:apply-templates />}}
147</xsl:template> 134</xsl:template>
148 135

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.20