/[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.6 Revision 1.7
36 36
37<xsl:template match="chapter"> 37<xsl:template match="chapter">
38<!-- Ignore developers and subprojects as these will be provided by the wiki itself. --> 38<!-- Ignore developers and subprojects as these will be provided by the wiki itself. -->
39<xsl:if test="not(title='Developers') and not(title='Subprojects')"> 39<xsl:if test="not(title='Developers') and not(title='Subprojects')">
40== <xsl:value-of select="title" /> ==<xsl:text> 40== <xsl:value-of select="title" /> ==<xsl:text>
41
41</xsl:text> 42</xsl:text>
42<xsl:apply-templates /> 43<xsl:apply-templates />
43</xsl:if> 44</xsl:if>
44</xsl:template> 45</xsl:template>
45 46
46<xsl:template match="section"> 47<xsl:template match="section">
47<xsl:if test="preceding-sibling::section"><xsl:text> 48<xsl:if test="preceding-sibling::section"><xsl:text>
48</xsl:text> 49</xsl:text>
49</xsl:if> 50</xsl:if>
50<xsl:if test="title"> 51<xsl:if test="title">
51=== <xsl:value-of select="title" /> === 52=== <xsl:value-of select="title" /> ===<xsl:text>
53
54</xsl:text>
52</xsl:if> 55</xsl:if>
53 56
54<xsl:apply-templates /> 57<xsl:apply-templates />
55</xsl:template> 58</xsl:template>
56 59
60 i is for in-pre commands, we cannot support that easily as we have no 63 i is for in-pre commands, we cannot support that easily as we have no
61 knowledge of what needs to be RootCmd, UserCmd, what is output, etc. 64 knowledge of what needs to be RootCmd, UserCmd, what is output, etc.
62--> 65-->
63<xsl:template match="i"><xsl:apply-templates /></xsl:template> 66<xsl:template match="i"><xsl:apply-templates /></xsl:template>
64 67
65<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> 68<xsl:template match="mail"><xsl:if test="string-length(preceding-sibling::text()) &gt; 1"><xsl:text> </xsl:text></xsl:if><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>
66 69
67<xsl:template match="p"><xsl:apply-templates /><xsl:text> 70<xsl:template match="p"><xsl:apply-templates /><xsl:text>
68 71
69</xsl:text> 72</xsl:text>
70</xsl:template> 73</xsl:template>
85<!-- 88<!--
86 const is formatting in pre, difficult to handle this 89 const is formatting in pre, difficult to handle this
87--> 90-->
88<xsl:template match="const"><xsl:apply-templates /></xsl:template> 91<xsl:template match="const"><xsl:apply-templates /></xsl:template>
89 92
90<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:when test="starts-with(@link, '#')">[[<xsl:value-of select="@link" />]]</xsl:when></xsl:choose><xsl:text> </xsl:text></xsl:template> 93<xsl:template match="uri"><xsl:if test="string-length(preceding-sibling::text()) &gt; 1"><xsl:text> </xsl:text></xsl:if><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:when test="starts-with(@link, '#')">[[<xsl:value-of select="@link" />]]</xsl:when></xsl:choose><xsl:if test="string-length(following-sibling::text()) &gt; 1"><xsl:text> </xsl:text></xsl:if></xsl:template>
91 94
92<xsl:template match="e"> ''<xsl:apply-templates />'' </xsl:template> 95<xsl:template match="e"> ''<xsl:apply-templates />'' </xsl:template>
93 96
94<xsl:template match="ul"><xsl:text> 97<xsl:template match="ul"><xsl:text>
95</xsl:text><xsl:apply-templates /><xsl:text> 98</xsl:text><xsl:apply-templates /><xsl:text>
112 115
113<xsl:template match="date" /> 116<xsl:template match="date" />
114 117
115<xsl:template match="version" /> 118<xsl:template match="version" />
116 119
117<xsl:template match="c"> &lt;code&gt;<xsl:apply-templates />&lt;/code&gt; </xsl:template> 120<xsl:template match="c"><xsl:if test="string-length(preceding-sibling::text()) &gt; 1"><xsl:text> </xsl:text></xsl:if>&lt;code&gt;<xsl:apply-templates />&lt;/code&gt;<xsl:if test="string-length(following-sibling::text()) &gt; 1"><xsl:text> </xsl:text></xsl:if></xsl:template>
118 121
119<xsl:template match="pre"><xsl:text> 122<xsl:template match="pre"><xsl:text>
120</xsl:text> 123</xsl:text>
121{{Code|<xsl:value-of select="@caption" />|&lt;pre&gt;<xsl:apply-templates />&lt;/pre&gt; 124{{Code|<xsl:value-of select="@caption" />|&lt;pre&gt;<xsl:apply-templates />&lt;/pre&gt;
122}} 125}}
126 129
127<xsl:template match="comment">## <xsl:apply-templates /></xsl:template> 130<xsl:template match="comment">## <xsl:apply-templates /></xsl:template>
128 131
129<xsl:template match="path"> {{Path|<xsl:apply-templates />}} </xsl:template> 132<xsl:template match="path"> {{Path|<xsl:apply-templates />}} </xsl:template>
130 133
131<xsl:template match="b"><xsl:text> </xsl:text>'''<xsl:apply-templates />'''<xsl:text> </xsl:text></xsl:template> 134<xsl:template match="b"><xsl:if test="string-length(preceding-sibling::text()) &gt; 1"><xsl:text> </xsl:text></xsl:if>'''<xsl:apply-templates />'''<xsl:if test="string-length(following-sibling::text()) &gt; 1"><xsl:text> </xsl:text></xsl:if></xsl:template>
132 135
133<xsl:template match="warn"> 136<xsl:template match="warn">
134{{Warning|<xsl:apply-templates />}} 137{{Warning|<xsl:apply-templates />}}
135</xsl:template> 138</xsl:template>
136 139

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20