1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'
3 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
5 <!-- Remove bits from the manual pages that are not relevant for the book -->
6 <xsl:import href="strip-references.xsl"/>
8 <xsl:param name="latex.mapping.xml" select="document('latex.overrides.xml')"/>
10 <xsl:param name="generate.toc">
14 book toc,title,figure,table,example,equation
15 /chapter toc,title,lop
31 <!-- Show real name of the link rather then user specified description
32 <xsl:template match="link">
33 <xsl:variable name="target" select="key('id',@linkend)[1]"/>
34 <xsl:variable name="refelem" select="local-name($target)"/>
35 <xsl:if test="$refelem=''">
36 <xsl:message><xsl:text>XRef to nonexistent id: </xsl:text><xsl:value-of select="@linkend"/></xsl:message>
37 <xsl:text>XrefId[?</xsl:text>
38 <xsl:apply-templates/>
39 <xsl:text>?]</xsl:text>
42 <xsl:call-template name="generate.hyperlink">
43 <xsl:with-param name="target" select="$target"/>
44 <xsl:with-param name="text">
45 <xsl:call-template name="generate.xref.text">
46 <xsl:with-param name="target" select="$target"/>
53 <xsl:output method="text" encoding="UTF-8" indent="yes"/>
54 <xsl:variable name="l10n.gentext.default.language" select="'en'"/>
55 <xsl:variable name="latex.example.caption.style"></xsl:variable>
56 <xsl:variable name="latex.hyperref.param.pdftex">hyperfigures,hyperindex,citecolor=black,urlcolor=black,filecolor=black,linkcolor=black,menucolor=red,pagecolor=black</xsl:variable>
57 <xsl:variable name="latex.use.tabularx">1</xsl:variable>
58 <xsl:variable name="latex.use.parskip">1</xsl:variable>
59 <xsl:variable name="latex.hyphenation.tttricks">1</xsl:variable>
60 <xsl:template name="latex.thead.row.entry">
61 <xsl:text>{\bfseries </xsl:text><xsl:apply-templates/><xsl:text>}</xsl:text>
63 <xsl:variable name="latex.class.book">sambadoc</xsl:variable>
64 <xsl:variable name="latex.babel.language">english</xsl:variable>
65 <xsl:variable name="ulink.footnotes" select="1"/>
66 <xsl:variable name="ulink.show" select="0"/>
68 <xsl:template match="smbconfblock/smbconfoption">
69 <xsl:text> </xsl:text><xsl:value-of select="@name"/>
70 <xsl:if test="text() != ''">
71 <xsl:text> = </xsl:text>
72 <xsl:value-of select="text()"/>
74 <xsl:text> </xsl:text>
77 <xsl:template match="smbconfblock/smbconfcomment">
78 <xsl:text># </xsl:text>
79 <xsl:apply-templates/>
80 <xsl:text> </xsl:text>
83 <xsl:template match="smbconfblock/smbconfsection">
84 <xsl:value-of select="@name"/>
85 <xsl:text> </xsl:text>
88 <xsl:template match="smbconfoption">
89 <xsl:text>\smbconfoption{</xsl:text>
90 <xsl:call-template name="scape">
91 <xsl:with-param name="string" select="@name"/>
93 <xsl:text>}</xsl:text>
96 <xsl:when test="text() != ''">
97 <xsl:text> = </xsl:text>
98 <xsl:call-template name="scape">
99 <xsl:with-param name="string" select="text()"/>
105 <xsl:template match="smbconfblock">
106 <xsl:text> \begin{lstlisting}[language=smbconf,style=smbconfblock] </xsl:text>
107 <xsl:apply-templates/>
108 <xsl:text>\end{lstlisting} </xsl:text>
111 <xsl:template match="smbconfsection">
112 <xsl:text>\smbconfsection{</xsl:text>
113 <xsl:call-template name="scape">
114 <xsl:with-param name="string" select="@name"/>
116 <xsl:text>}</xsl:text>
119 <xsl:template match="imagefile">
120 <xsl:text>\includegraphics[scale=</xsl:text>
122 <xsl:when test="@scale != ''"><xsl:value-of select="@scale div 100"/></xsl:when>
124 <xsl:otherwise><xsl:text>.50</xsl:text></xsl:otherwise>
126 <xsl:text>]{</xsl:text>
127 <xsl:value-of select="text()"/>
128 <xsl:text>} </xsl:text>
131 <!-- smb.conf documentation -->
133 <xsl:template match="description"><xsl:apply-templates/></xsl:template>
135 <xsl:template match="value"><xsl:apply-templates/></xsl:template>
137 <xsl:template match="synonym"><xsl:apply-templates/></xsl:template>
139 <xsl:template match="related"><xsl:apply-templates/></xsl:template>
141 <xsl:template match="//samba:parameterlist">
142 <xsl:text>\begin{description} </xsl:text>
143 <xsl:apply-templates>
144 <xsl:sort select="samba:parameter/@name"/>
145 </xsl:apply-templates>
146 <xsl:text>\end{description} </xsl:text>
149 <xsl:template match="value/comment">
150 <xsl:text> # </xsl:text>
151 <xsl:apply-templates/>
154 <xsl:template match="/">
155 <xsl:apply-templates/>
158 <xsl:template match="refentry">
159 <xsl:text>\section{</xsl:text><xsl:value-of select="refmeta/refentrytitle"/><xsl:text>} </xsl:text>
160 <xsl:apply-templates/>
163 <xsl:template match="//samba:parameter">
164 <xsl:for-each select="synonym">
165 <xsl:text>\item[{</xsl:text><xsl:value-of select="."/><xsl:text>}]\null{} </xsl:text>
166 <xsl:text>\index{</xsl:text><xsl:value-of select="."/><xsl:text>} </xsl:text>
167 <xsl:text>This parameter is a synonym for \smbconfoption{</xsl:text><xsl:value-of select="../@name"/><xsl:text>}.</xsl:text>
170 <xsl:text>\item[{</xsl:text><xsl:value-of select="@name"/>
171 <xsl:text> (</xsl:text>
172 <xsl:value-of select="@context"/>
173 <xsl:text>)</xsl:text>
174 <xsl:text>}]\null{} </xsl:text>
175 <xsl:text>\index{</xsl:text><xsl:value-of select="@name"/><xsl:text>} </xsl:text>
177 <!-- Print default value-->
178 <xsl:text> </xsl:text>
179 <xsl:text>Default: </xsl:text>
180 <xsl:text>\emph{</xsl:text>
182 <xsl:when test="value[@type='default'] != ''">
183 <xsl:value-of select="@name"/>
184 <xsl:text> = </xsl:text>
185 <xsl:apply-templates select="value"/>
188 <xsl:text>No default</xsl:text>
191 <xsl:text>}</xsl:text>
192 <xsl:text> </xsl:text>
194 <!-- Generate list of examples -->
195 <xsl:text> </xsl:text>
196 <xsl:for-each select="value[@type='example']">
197 <xsl:text> </xsl:text>
198 <xsl:text>Example: </xsl:text>
199 <xsl:text>\emph{</xsl:text><xsl:value-of select="../@name"/>
200 <xsl:text> = </xsl:text>
201 <xsl:apply-templates select="."/>
202 <xsl:text>}</xsl:text>
203 <xsl:text> </xsl:text>
207 <xsl:apply-templates select="description"/>