diff options
Diffstat (limited to 'docs-xml/xslt')
-rw-r--r-- | docs-xml/xslt/docbook2pearson.xsl | 1042 | ||||
-rw-r--r-- | docs-xml/xslt/expand-sambadoc.xsl | 177 | ||||
-rw-r--r-- | docs-xml/xslt/expand-smbconfdoc.xsl | 191 | ||||
-rw-r--r-- | docs-xml/xslt/generate-attributions.xsl | 84 | ||||
-rw-r--r-- | docs-xml/xslt/generate-dependencies.xsl | 36 | ||||
-rw-r--r-- | docs-xml/xslt/html-chunk.xsl | 12 | ||||
-rw-r--r-- | docs-xml/xslt/html-common.xsl | 85 | ||||
-rw-r--r-- | docs-xml/xslt/html.xsl | 7 | ||||
-rw-r--r-- | docs-xml/xslt/html/samba.css | 80 | ||||
-rw-r--r-- | docs-xml/xslt/latex.overrides.xml | 9 | ||||
-rw-r--r-- | docs-xml/xslt/latex.xsl | 64 | ||||
-rw-r--r-- | docs-xml/xslt/latex/samba.sty | 25 | ||||
-rw-r--r-- | docs-xml/xslt/latex/samba.xsl | 146 | ||||
-rw-r--r-- | docs-xml/xslt/latex/sambadoc.cls | 324 | ||||
-rw-r--r-- | docs-xml/xslt/man.xsl | 89 | ||||
-rw-r--r-- | docs-xml/xslt/manpage-summary.xsl | 42 | ||||
-rw-r--r-- | docs-xml/xslt/sambadoc2pearson.xsl | 82 | ||||
-rw-r--r-- | docs-xml/xslt/smb.conf-html.xsl | 103 | ||||
-rw-r--r-- | docs-xml/xslt/strip-references.xsl | 8 | ||||
-rw-r--r-- | docs-xml/xslt/yodl.xsl | 321 |
20 files changed, 2927 insertions, 0 deletions
diff --git a/docs-xml/xslt/docbook2pearson.xsl b/docs-xml/xslt/docbook2pearson.xsl new file mode 100644 index 0000000..196941a --- /dev/null +++ b/docs-xml/xslt/docbook2pearson.xsl @@ -0,0 +1,1042 @@ +<?xml version='1.0'?> +<!-- + Convert DocBook to XML validating against the Pearson DTD + + (C) Jochen Hein + (C) Jelmer Vernooij <jelmer@samba.org> 2004 +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + exclude-result-prefixes="doc" + version="1.1"> + + <!-- TODO <entry></entry> -> <entry><p/></entry> --> + + <xsl:output method="xml" + encoding="UTF-8" + doctype-public="-//Pearson//DTD Books//DE" + doctype-system="http://www.pearson.de/pearson.dtd" + indent="yes" + omit-xml-declaration="no" + standalone="no"/> + + <!-- Warn about DocBook elements that are not converted --> + <xsl:template match="*"> + <xsl:message> + <xsl:text>No template matches </xsl:text> + <xsl:value-of select="name(.)"/> + <xsl:text>.</xsl:text> + </xsl:message> + </xsl:template> + + <!-- + ==================================================================== + --> + <!-- Establish strip/preserve whitespace rules --> + + <xsl:preserve-space elements="*"/> + + <xsl:strip-space elements=" + abstract affiliation anchor answer appendix area areaset areaspec + artheader article audiodata audioobject author authorblurb authorgroup + beginpage bibliodiv biblioentry bibliography biblioset blockquote book + bookbiblio bookinfo callout calloutlist caption caution + city pubdate publisher publishername"/> + + <xsl:template name="transform.id.attribute"> + <xsl:if test="@id != ''"> + <xsl:attribute name="id"> + <xsl:value-of select="@id"/> + </xsl:attribute> + </xsl:if> + </xsl:template> + + <xsl:template match="/" mode="default"> + <xsl:processing-instruction + name="xml-stylesheet">href="pearson.css" + type="text/css"</xsl:processing-instruction> + <xsl:text> + </xsl:text> + <xsl:comment> + <xsl:text>Transformed with pearson.xsl by Jochen Hein</xsl:text> + </xsl:comment> + <xsl:text> + </xsl:text> + <!-- Releaseinfo einbauen? --> + <xsl:comment> + <xsl:apply-templates select=".//releaseinfo" mode="comment"/> + </xsl:comment> + <xsl:text> + </xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="book"> + <book> + <xsl:apply-templates/> + </book> + </xsl:template> + + <xsl:template match="bookinfo"> + <bookinfo> + <xsl:apply-templates/> + </bookinfo> + </xsl:template> + + <xsl:template match="author"> + <author> + <xsl:apply-templates/> + </author> + </xsl:template> + + <xsl:template match="editor"> + <editor> + <xsl:apply-templates/> + </editor> + </xsl:template> + + <xsl:template match="chapter"> + <chapter> + <xsl:call-template name="transform.id.attribute"/> + <xsl:apply-templates/> + </chapter> + </xsl:template> + + <xsl:template match="chapter/title/command"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="index"> + <xsl:comment> XXX insert index here </xsl:comment> + </xsl:template> + + <xsl:template match="preface"> + <preface> + <xsl:call-template name="transform.id.attribute"/> + <xsl:apply-templates/> + </preface> + </xsl:template> + + <xsl:template match="section|sect1|sect2|sect3|sect4"> + <sect> + <xsl:call-template name="transform.id.attribute"/> + <xsl:apply-templates/> + </sect> + </xsl:template> + + <xsl:template match="partintro"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="part"> + <appendix> + <xsl:apply-templates/> + </appendix> + </xsl:template> + + <xsl:template match="appendix[1]"> + <appendix> + <chapter> + <xsl:call-template name="transform.id.attribute"/> + <xsl:apply-templates/> + </chapter> + <xsl:for-each select="following-sibling::appendix"> + <chapter> + <xsl:call-template name="transform.id.attribute"/> + <xsl:apply-templates/> + </chapter> + </xsl:for-each> + </appendix> + </xsl:template> + + <xsl:template match="appendix[position() != 1]"> + </xsl:template> + + <xsl:template match="title"> + <title><xsl:apply-templates/></title> + </xsl:template> + + <xsl:param name="notpchilds" select="'variablelist itemizedlist orderedlist'"/> + + <xsl:template match="para"> + <!-- loop thru all elements: --> + <xsl:for-each select="*|text()"> + <xsl:choose> + <xsl:when test="string-length(name(.)) > 0 and contains($notpchilds,name(.))"> + <xsl:message><xsl:text>Removing from p:</xsl:text><xsl:value-of select="name(.)"/></xsl:message> + <xsl:apply-templates select="."/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="hstartpara"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:template> + + <!-- Do open paragraph when previous sibling was not a valid p child --> + <xsl:template name="hstartpara"> + <xsl:if test="not(preceding-sibling::*[1]) or (contains($notpchilds,name(preceding-sibling::*[1])) and not(string-length(name(.)) > 0))"> + <p> + <xsl:apply-templates select="."/> + <xsl:for-each select="following-sibling::*[not(contains($notpchilds,name(.)) and string-length(name(.)) > 0)]"> + <xsl:apply-templates select="."/> + </xsl:for-each> + </p> + </xsl:if> + </xsl:template> + + <xsl:template name="hsubpara"> + <xsl:param name="data"/> + <xsl:apply-templates select="$data"/> + <xsl:if test="$data[following-sibling::*[1]]"> + <xsl:param name="next" select="$data[following-sibling::*[1]]"/> + <xsl:message><xsl:value-of select="name(.)"/></xsl:message> + <xsl:if test="$next and (not(contains($notpchilds,name($next))) or $next[text()])"> + <xsl:message><xsl:text>Followed by : </xsl:text><xsl:value-of select="name($next)"/></xsl:message> + <xsl:call-template name="hsubpara"> + <xsl:with-param name="data" select="$next"/> + </xsl:call-template> + <xsl:message><xsl:text>Done Followed by : </xsl:text><xsl:value-of select="name($next)"/></xsl:message> + </xsl:if> + </xsl:if> + </xsl:template> + + <xsl:template match="tip"> + <tip><xsl:apply-templates/></tip> + </xsl:template> + + <xsl:template match="warning|important|caution"> + <stop><xsl:apply-templates/></stop> + </xsl:template> + + <xsl:template match="note"> + <info><xsl:apply-templates/></info> + </xsl:template> + + <xsl:template match="emphasis"> + <xsl:variable name="role" select="@role"/> + + <xsl:choose> + <xsl:when test="$role='italic'"> + <i><xsl:apply-templates/></i> + </xsl:when> + <xsl:otherwise> + <em><xsl:apply-templates/></em> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="ulink"> + <xsl:apply-templates/> + <footnote><p><url><xsl:value-of select="@ulink"/></url></p></footnote> + </xsl:template> + + <xsl:template match="email"> + <url>mailto:<xsl:apply-templates/></url> + </xsl:template> + + <xsl:template match="indexterm"> + <ie><xsl:apply-templates/></ie> + </xsl:template> + + <xsl:template match="primary"> + <t><xsl:apply-templates/></t> + </xsl:template> + + <xsl:template match="secondary"> + <t><xsl:apply-templates/></t> + </xsl:template> + + <xsl:template match="citerefentry"> + <xsl:value-of select="refentrytitle"/><xsl:text>(</xsl:text><xsl:value-of select="manvolnum"/><xsl:text>)</xsl:text> + </xsl:template> + + <xsl:template match="formalpara"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="substeps"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="see|seealso"> + <synonym><xsl:apply-templates/></synonym> + </xsl:template> + + <xsl:template + match="footnote"><footnote><xsl:apply-templates/></footnote></xsl:template> + + <xsl:template match="command"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="function"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="systemitem"> + + <!-- xsl:if test="@role != '' and @role != 'signal'"> + <xsl:message> + Warning: role attribute is <xsl:value-of select="@role"/> + </xsl:message> + </xsl:if --> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="sgmltag"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="filename"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="errorcode"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="errortype"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="returnvalue"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="glosslist|glossary"> + <dl><xsl:apply-templates/></dl> + </xsl:template> + + <xsl:template match="glossentry"> + <dlitem><xsl:apply-templates/></dlitem> + </xsl:template> + + <xsl:template match="glossentry/acronym"> + <dt><xsl:apply-templates/></dt> + </xsl:template> + + <xsl:template match="acronym"> + <b><xsl:apply-templates/></b> + </xsl:template> + + <xsl:template match="glossterm"> + <dt><xsl:apply-templates/></dt> + </xsl:template> + + <xsl:template match="glossdef"> + <dd><xsl:apply-templates/></dd> + </xsl:template> + + <xsl:template match="itemizedlist"> + <ul><xsl:apply-templates/></ul> + </xsl:template> + + <xsl:template match="varlistentry/term"> + <dt><xsl:apply-templates/></dt> + </xsl:template> + + <xsl:template match="varlistentry/listitem"> + <dd><xsl:apply-templates/></dd> + </xsl:template> + + <xsl:template match="varlistentry"> + <dlitem> + <xsl:apply-templates/> + </dlitem> + </xsl:template> + + <xsl:template match="variablelist"> + <dl><xsl:apply-templates/></dl> + </xsl:template> + + <xsl:template match="simplelist"> + <ul> + <xsl:for-each select="member"> + <li><p><xsl:apply-templates/></p></li> + </xsl:for-each> + </ul> + </xsl:template> + + <xsl:template match="orderedlist"> + <xsl:variable name="numeration" select="@numeration"/> + <ol> + <xsl:if test="$numeration != ''"> + <xsl:attribute name="type"> + <xsl:value-of select="$numeration"/> + </xsl:attribute> + </xsl:if> + <xsl:apply-templates/> + </ol> + </xsl:template> + + <xsl:template match="listitem"> + <li><xsl:apply-templates/></li> + </xsl:template> + + <xsl:template match="firstterm"> + <em><xsl:apply-templates/></em> + </xsl:template> + + <xsl:template match="literal/systemitem"> + <em><xsl:apply-templates/></em> + </xsl:template> + + <xsl:template match="superscript"> + <sup><xsl:apply-templates/></sup> + </xsl:template> + + <xsl:template match="productname"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="keycombo"> + + <xsl:variable name="action" select="@action"/> + <xsl:variable name="joinchar"> + + <xsl:choose> + + <xsl:when test="$action='seq'"> + <xsl:text> </xsl:text></xsl:when> + <xsl:when test="$action='simul'">+</xsl:when> + <xsl:when test="$action='press'">-</xsl:when> + <xsl:when test="$action='click'">-</xsl:when> + <xsl:when test="$action='double-click'">-</xsl:when> + <xsl:when test="$action='other'"></xsl:when> + <xsl:otherwise>-</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:for-each select="*"> + <xsl:if test="position()>1"><xsl:value-of + select="$joinchar"/></xsl:if> + <xsl:apply-templates select="."/> + </xsl:for-each> + + </xsl:template> + + + <xsl:template match="keycap"> + <key><xsl:apply-templates/></key> + </xsl:template> + + <xsl:template match="keycap/replaceable"> + <xsl:apply-templates/> + </xsl:template> + + + + <xsl:template match="menuchoice"> + <xsl:variable name="shortcut" select="./shortcut"/> + <xsl:call-template name="process.menuchoice"/> + <xsl:if test="$shortcut"> + <xsl:text> (</xsl:text> + <xsl:apply-templates select="$shortcut"/> + <xsl:text>)</xsl:text> + </xsl:if> + </xsl:template> + + <xsl:template name="process.menuchoice"> + <xsl:param name="nodelist" + select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) --> + <xsl:param name="count" select="1"/> + + <xsl:choose> + <xsl:when test="$count>count($nodelist)"></xsl:when> + <xsl:when test="$count=1"> + <xsl:apply-templates select="$nodelist[$count=position()]"/> + <xsl:call-template name="process.menuchoice"> + <xsl:with-param name="nodelist" select="$nodelist"/> + <xsl:with-param name="count" select="$count+1"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="node" select="$nodelist[$count=position()]"/> + <xsl:choose> + <xsl:when test="name($node)='guimenuitem' + or name($node)='guisubmenu'"> + <xsl:text>-></xsl:text> + </xsl:when> + <xsl:otherwise>+</xsl:otherwise> + </xsl:choose> + <xsl:apply-templates select="$node"/> + <xsl:call-template name="process.menuchoice"> + <xsl:with-param name="nodelist" select="$nodelist"/> + <xsl:with-param name="count" select="$count+1"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template match="guimenu"> + <guiitem><xsl:apply-templates/></guiitem> + </xsl:template> + + <xsl:template match="guimenuitem"> + <guiitem><xsl:apply-templates/></guiitem> + </xsl:template> + + <xsl:template match="guiicon"> + <guiitem><xsl:apply-templates/></guiitem> + </xsl:template> + + <xsl:template match="guilabel"> + <guiitem><xsl:apply-templates/></guiitem> + </xsl:template> + + <xsl:template match="guibutton"> + <guiitem><xsl:apply-templates/></guiitem> + </xsl:template> + + <xsl:template name="transform.epigraph"> + <xsl:apply-templates select="para"/> + <xsl:apply-templates select="attribution"/> + </xsl:template> + + <xsl:template match="epigraph"> + <chapterintro><motto><xsl:call-template + name="transform.epigraph"/></motto></chapterintro> + </xsl:template> + + <xsl:template match="section/epigraph"> + <motto><xsl:call-template name="transform.epigraph"/></motto> + </xsl:template> + + <xsl:template match="epigraph/para"> + <p><em><xsl:apply-templates/></em></p> + </xsl:template> + <xsl:template match="attribution"> + <p><i><xsl:apply-templates/></i></p> + </xsl:template> + + <xsl:template match="errorname"> + <i><xsl:apply-templates/></i> + </xsl:template> + + <xsl:template match="constant"> + <b><xsl:apply-templates/></b> + </xsl:template> + + <xsl:template match="envar"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="literal"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="option"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="parameter"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="application"> + <b><xsl:apply-templates/></b> + </xsl:template> + + <xsl:template match="screen/userinput"> + <b><xsl:apply-templates/></b> + </xsl:template> + + <xsl:template match="screen/prompt"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="prompt"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="userinput"> + <code><b><xsl:apply-templates/></b></code> + </xsl:template> + + <xsl:template match="computeroutput"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="screen/computeroutput"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="replaceable"> + <i><xsl:apply-templates/></i> + </xsl:template> + + <xsl:template match="userinput/replaceable"> + <i><xsl:apply-templates/></i> + </xsl:template> + + <xsl:template match="citation" + xmlns:xlink="http://www.w3.org/1999/xlink"> + + <xsl:variable name="target" select="."/> + <xsl:variable name="targets" select="id($target)"/> + + <!-- xsl:call-template name="check.id.unique"> + <xsl:with-param name="linkend" select="$target"/> + </xsl:call-template --> + + <xsl:choose> + <xsl:when test="count($targets) = 0"> + <xsl:message> + <xsl:text>Citation of nonexistent id: </xsl:text> + <xsl:value-of select="."/> + </xsl:message> + <xsl:text>[??? </xsl:text> + <xsl:value-of select="."/> + <xsl:text>]</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>[</xsl:text><xsl:value-of + select="."/><xsl:text>]</xsl:text> + </xsl:otherwise> + </xsl:choose> + + </xsl:template> + + <xsl:template match="figure"> + <figure> + <xsl:call-template name="transform.id.attribute"/> + <xsl:apply-templates/> + </figure> + </xsl:template> + + <xsl:template match="graphic"> + <xsl:message> + <xsl:text>Obsolete tag "graphic" found.</xsl:text> + </xsl:message> + + <figureref> + <xsl:attribute name="fileref"> + <xsl:value-of select="@fileref"/> + </xsl:attribute> + </figureref> + </xsl:template> + + <xsl:template match="mediaobject"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="imageobject"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="imagedata"> + <xsl:variable name="scale" select="@scale"/> + <figureref> + <xsl:attribute name="fileref"> + <xsl:value-of select="@fileref"/> + </xsl:attribute> + <xsl:if test="$scale != ''"> + <xsl:attribute name="scale"><xsl:value-of + select="$scale"/>%</xsl:attribute> + </xsl:if> + </figureref> + </xsl:template> + + <xsl:template match="example"> + <screen> + <xsl:call-template name="transform.id.attribute"/> + <xsl:apply-templates/> + </screen> + </xsl:template> + + <xsl:template match="listing"> + <screen> + <xsl:call-template name="transform.id.attribute"/> + <xsl:apply-templates/> </screen> + </xsl:template> + + <xsl:template name="check.title.not.empty"> + <xsl:variable name="title" select="."/> + <xsl:if test="$title=''"> + <xsl:message>title tag is empty!</xsl:message> + </xsl:if> + </xsl:template> + + <xsl:template match="figure/title"> + <xsl:call-template name="check.title.not.empty"/> + <description><xsl:apply-templates/></description> + </xsl:template> + <xsl:template match="listing/title"> + <xsl:call-template name="check.title.not.empty"/> + <description><xsl:apply-templates/></description> + </xsl:template> + <xsl:template match="example/title"> + <xsl:call-template name="check.title.not.empty"/> + <description><xsl:apply-templates/></description> + </xsl:template> + + <xsl:template match="literallayout"> + <screentext><xsl:apply-templates/></screentext> + </xsl:template> + <xsl:template match="screen"> + <screentext><xsl:apply-templates/></screentext> + </xsl:template> + + <xsl:template match="programlisting"> + <listing> + <xsl:if test="title != ''"> + <description><xsl:value-of select="title"/></description> + </xsl:if> + <listingcode> + <xsl:apply-templates/> + </listingcode> + </listing> + </xsl:template> + + <!-- Tabellen --> + <xsl:template match="table"> + <table> + <xsl:call-template name="transform.id.attribute"/> + <xsl:apply-templates/> + </table> + </xsl:template> + <xsl:template match="table/title"> + <description><xsl:apply-templates/></description> + </xsl:template> + + <xsl:template match="tgroup"> + <tgroup> + <xsl:attribute name="cols"> + <xsl:value-of select="@cols"/></xsl:attribute> + <xsl:apply-templates/> + </tgroup> + </xsl:template> + <xsl:template match="thead"> + <thead><xsl:apply-templates/></thead> + </xsl:template> + <xsl:template match="tbody"> + <tbody><xsl:apply-templates/></tbody> + </xsl:template> + <xsl:template match="row"> + <row><xsl:apply-templates/></row> + </xsl:template> + <xsl:template match="entry"> + <entry><p><xsl:apply-templates/></p></entry> + </xsl:template> + <xsl:template match="colspec"> + <colspec><xsl:copy-of select="@*"/><xsl:apply-templates/></colspec> + </xsl:template> + + <!-- xref nach pearson-equivalent - Einige Ideen stammen von Norm --> + + <xsl:template name="object.id"> + <xsl:param name="object" select="."/> + <xsl:choose> + <xsl:when test="$object/@id"> + <xsl:value-of select="$object/@id"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="generate-id($object)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template name="anchor"> + <xsl:param name="node" select="."/> + <xsl:param name="conditional" select="1"/> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="$node"/> + </xsl:call-template> + </xsl:variable> + <xsl:if test="$conditional = 0 or $node/@id"> + <a name="{$id}"/> + </xsl:if> + </xsl:template> + + <xsl:template name="check.id.unique"> + <xsl:param name="linkend"></xsl:param> + <xsl:if test="$linkend != ''"> + <xsl:variable name="targets" select="id($linkend)"/> + <xsl:variable name="target" select="$targets[1]"/> + + <xsl:if test="count($targets)=0"> + <xsl:message> + <xsl:text>Error: no ID for constraint linkend: </xsl:text> + <xsl:value-of select="$linkend"/> + <xsl:text>.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="count($targets)>1"> + <xsl:message> + <xsl:text>Warning: multiple "IDs" for constraint linkend: + </xsl:text> + <xsl:value-of select="$linkend"/> + <xsl:text>.</xsl:text> + </xsl:message> + </xsl:if> + </xsl:if> + </xsl:template> + + <xsl:template match="xref|link" + xmlns:xlink="http://www.w3.org/1999/xlink"> + <xsl:variable name="linkend" select="@linkend"/> + <xsl:variable name="targets" select="id(@linkend)"/> + <xsl:variable name="target" select="$targets[1]"/> + <xsl:variable name="refelem" select="local-name($target)"/> + + <xsl:call-template name="check.id.unique"> + <xsl:with-param name="linkend" select="$linkend"/> + </xsl:call-template> + + <xsl:call-template name="anchor"/> + + <xsl:choose> + <xsl:when test="count($targets) = 0"> + <xsl:message> + <xsl:text>XRef to nonexistent id: </xsl:text> + <xsl:value-of select="@linkend"/> + </xsl:message> + <xsl:text>[??? </xsl:text> + <xsl:value-of select="@linkend"/> + <xsl:text>]</xsl:text> + </xsl:when> + <xsl:when test="count($targets) > 1"> + <xsl:message>Uh, multiple linkends + <xsl:value-of select="@linkend"/> + </xsl:message> + </xsl:when> + </xsl:choose> + + <xsl:choose> + <xsl:when test='$refelem = "chapter" or $refelem = "preface"'> + <xsl:text>Kapitel </xsl:text> + </xsl:when> + <xsl:when test='$refelem = "section" or $refelem = "sect1" or $refelem = "sect2" or $refelem = "sect3" or $refelem = "sect4"'> + <xsl:text>Abschnitt </xsl:text> + </xsl:when> + <xsl:when test='$refelem = "figure"'> + <xsl:text>Abbildung </xsl:text> + </xsl:when> + <xsl:when test='$refelem = "example"'> + <!-- xsl:choose> + <xsl:when test="$target/@role='listing'"> + <xsl:text>Listing </xsl:text> + </xsl:when> + <xsl:otherwise --> + <xsl:text>Listing </xsl:text> + <!-- /xsl:otherwise> + </xsl:choose --> + </xsl:when> + <xsl:when test='$refelem = "table"'> + <xsl:text>Tabelle </xsl:text> + </xsl:when> + <xsl:when test='$refelem = "appendix"'> + <xsl:text>Anhang </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:if test="$refelem != ''"> + <xsl:message> + <xsl:text>Can't handle xref to </xsl:text> + <xsl:value-of select="$refelem"/> + <xsl:text>:</xsl:text> + <xsl:value-of select="@linkend"/> + </xsl:message> + <xsl:text>(??? $refelem)</xsl:text> + </xsl:if> + </xsl:otherwise> + </xsl:choose> + + <xref> + <xsl:attribute name="xlink:href" + xmlns:xlink="http://www.w3.org/1999/xlink"> + <!-- xsl:attribute name="id" --> + <xsl:value-of select="@linkend"/> + </xsl:attribute> + </xref> + </xsl:template> + + <xsl:template match="quote">"<xsl:apply-templates/>"</xsl:template> + <!-- xsl:template + match="quote"><quote><xsl:apply-templates/></quote></xsl:template --> + + + <xsl:template match="othername"> + <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>0 + </xsl:template> + <xsl:template match="firstname"> + <xsl:apply-templates/><xsl:text> </xsl:text> + </xsl:template> + <xsl:template match="surname"> + <xsl:apply-templates/> + </xsl:template> + <xsl:template match="copyright"> + <!-- empty --> + </xsl:template> + <xsl:template match="edition"> + <!-- empty --> + </xsl:template> + <xsl:template match="publisher"> + <!-- empty --> + </xsl:template> + <xsl:template match="pubdate"> + <xsl:apply-templates/> + </xsl:template> + <xsl:template match="isbn"> + ISBN <xsl:apply-templates/> + </xsl:template> + + <!-- Literaturverzeichnis --> + <xsl:template match="bibliography"> + <sect> + <xsl:apply-templates/> + </sect> + </xsl:template> + + <xsl:template name="process.bibliomixed"> + + <xsl:variable name="bibid" select="id(@id)"/> + <dlitem><dt>[<xsl:value-of select="@id"/>]</dt> + <dd><p><xsl:apply-templates select=".//title"/>, + <xsl:if test="count(.//subtitle)>0"> + <xsl:apply-templates select=".//subtitle"/>, + </xsl:if> + <xsl:apply-templates select=".//author"/> + <xsl:apply-templates select=".//publisher"/> + <xsl:apply-templates select=".//pubdate"/> + <xsl:if test="count(.//isbn)>0"> + <xsl:text>, </xsl:text> + <xsl:apply-templates select=".//isbn"/> + </xsl:if> + <xsl:text>.</xsl:text></p> + <xsl:call-template name="process.abstract" select=".//abstract"/> + </dd> + </dlitem> + </xsl:template> + + <xsl:template match="bibliomixed[1]"> + <dl><xsl:call-template name="process.bibliomixed"/> + <xsl:for-each select="following-sibling::bibliomixed"> + <xsl:call-template name="process.bibliomixed"/> + </xsl:for-each> + </dl> + </xsl:template> + + + <xsl:template match="bibliomixed/title"> + <i><xsl:apply-templates/></i> + </xsl:template> + + <xsl:template match="biblioentry/title"> + <i><xsl:apply-templates/></i> + </xsl:template> + + <xsl:template match="bibliomixed/subtitle"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="bibliomixed/publisher"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="publishername"> + <xsl:apply-templates/>, + </xsl:template> + <xsl:template match="publisher/address"> + <xsl:apply-templates/> + </xsl:template> + <xsl:template match="city"> + <xsl:apply-templates/>, + </xsl:template> + + <xsl:template name="process.abstract"> + <xsl:apply-templates select="abstract//para"/> + </xsl:template> + <xsl:template match="bibliomixed"> + <!-- empty --> + </xsl:template> + + <xsl:template match="chapterinfo"> + <!-- empty --> + </xsl:template> + + <xsl:template match="sectioninfo"> + <!-- empty --> + </xsl:template> + + <xsl:template match="prefaceinfo"> + <!-- empty --> + </xsl:template> + + <xsl:template match="appendixinfo"> + <!-- empty --> + </xsl:template> + + <xsl:template match="releaseinfo"> + <xsl:comment><xsl:apply-templates/></xsl:comment> + </xsl:template> + + <xsl:template match="releaseinfo" mode="comment"> + <xsl:text> + </xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="trademark"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="processing-instruction('linebreak')"> + <br/> + </xsl:template> + + <xsl:template match="processing-instruction('pearson')"> + <xsl:copy/> + </xsl:template> + + <xsl:template match="procedure"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="step"> + <step><xsl:apply-templates/></step> + </xsl:template> + + <xsl:template match="toc"> + <xsl:element name="toc"> + <xsl:attribute name="role"> + <xsl:text>sect</xsl:text> + </xsl:attribute> + </xsl:element> + </xsl:template> + + <xsl:template match="lot"> + <xsl:element name="toc"> + <xsl:attribute name="role"> + <xsl:text>table</xsl:text> + </xsl:attribute> + </xsl:element> + </xsl:template> + + <xsl:template match="lof"> + <xsl:element name="toc"> + <xsl:attribute name="role"> + <xsl:text>figure</xsl:text> + </xsl:attribute> + </xsl:element> + </xsl:template> + + <xsl:template match="blockquote"> + <motto><xsl:apply-templates/></motto> + </xsl:template> + + <xsl:template match="authorgroup"> + <xsl:apply-templates/> + </xsl:template> + + + <xsl:template match="affiliation"> + <!-- Ignoring affiliations for now --> + </xsl:template> + +</xsl:stylesheet> diff --git a/docs-xml/xslt/expand-sambadoc.xsl b/docs-xml/xslt/expand-sambadoc.xsl new file mode 100644 index 0000000..65b22fc --- /dev/null +++ b/docs-xml/xslt/expand-sambadoc.xsl @@ -0,0 +1,177 @@ +<?xml version='1.0'?> +<!-- + Samba-documentation specific stylesheets. + This stylesheet eliminates Samba-specific XML elements and replaces them with + DocBook-only elements. + Published under the GNU GPLv3 or later + + (C) Jelmer Vernooij 2002-2004 +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:samba="http://www.samba.org/samba/DTD/samba-doc" + xmlns:xlink='http://www.w3.org/1999/xlink' + version="1.1"> + + <xsl:output method="xml" encoding="UTF-8" doctype-public="-//OASIS//DTD DocBook XML V4.2//EN" indent="yes" doctype-system="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"/> + + <xsl:include href="strip-references.xsl"/> + <xsl:include href="expand-smbconfdoc.xsl"/> + + <!-- This is needed to copy content unchanged --> + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template name="xsmbconfoption"> + <xsl:param name="name"/> + <xsl:param name="content"/> + <xsl:variable name="linkcontent"> + <xsl:element name="parameter"> + <xsl:attribute name="moreinfo"> + <xsl:text>none</xsl:text> + </xsl:attribute> + <xsl:value-of select="$name"/> + </xsl:element> + + <xsl:choose> + <xsl:when test="$content != ''"> + <xsl:text> = </xsl:text> + <xsl:value-of select="$content"/> + </xsl:when> + </xsl:choose> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$noreference = 1"> + <xsl:value-of select="$linkcontent"/> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="newid"><xsl:value-of select="translate(string($name),'abcdefghijklmnopqrstuvwxyz ','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/></xsl:variable> + <xsl:element name="link"> + <xsl:attribute name="linkend"> + <xsl:value-of select="$newid"/> + </xsl:attribute> + <xsl:attribute name="xlink:href">smb.conf.5.html#<xsl:value-of select="$newid"/></xsl:attribute> + <xsl:value-of select="$linkcontent"/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="related"> + <xsl:element name="para"> + <xsl:text>Related command: </xsl:text> + <xsl:call-template name="xsmbconfoption"> + <xsl:with-param name="name" select="text()"/> + </xsl:call-template> + </xsl:element> + </xsl:template> + + <xsl:template match="smbconfblock/smbconfoption"> + <xsl:element name="member"> + <xsl:element name="indexterm"> + <xsl:value-of select="@name"/> + </xsl:element> + <xsl:choose> + <xsl:when test="text() != ''"> + <xsl:element name="parameter"> + <xsl:value-of select="@name"/> + <xsl:text> = </xsl:text> + <xsl:value-of select="text()"/> + </xsl:element> + </xsl:when> + </xsl:choose> + </xsl:element> + </xsl:template> + + <xsl:template match="smbconfblock/smbconfcomment"> + <xsl:element name="member"> + <xsl:text># </xsl:text> + <xsl:apply-templates/> + </xsl:element> + </xsl:template> + + <xsl:template match="smbconfblock/smbconfsection"> + <xsl:element name="member"> + <xsl:text> </xsl:text> + </xsl:element> + <xsl:element name="member"> + <xsl:element name="parameter"> + <xsl:value-of select="@name"/> + </xsl:element> + </xsl:element> + </xsl:template> + + <xsl:template match="smbconfoption"> + <xsl:call-template name="xsmbconfoption"> + <xsl:with-param name="name" select="@name"/> + <xsl:with-param name="content" select="text()"/> + </xsl:call-template> + </xsl:template> + + + <xsl:template match="smbconfblock"> + <xsl:element name="simplelist"> + <xsl:apply-templates/> + </xsl:element> + </xsl:template> + + <xsl:template match="smbconfsection"> + <xsl:element name="parameter"> + <xsl:value-of select="@name"/> + </xsl:element> + </xsl:template> + + <xsl:template match="imagefile"> + <xsl:element name="mediaobject"> + <xsl:element name="imageobject"> + <xsl:attribute name="role"><xsl:text>html</xsl:text></xsl:attribute> + <xsl:element name="imagedata"> + <xsl:attribute name="fileref"> + <xsl:text>images/</xsl:text><xsl:value-of select="text()"/><xsl:text>.png</xsl:text></xsl:attribute> + <xsl:attribute name="scale"> + <xsl:choose> + <xsl:when test="@scale != ''"> + <xsl:value-of select="@scale"/> + </xsl:when> + + <xsl:otherwise> + <xsl:text>100</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:attribute name="scalefit"><xsl:text>1</xsl:text></xsl:attribute> + </xsl:element> + </xsl:element> + <xsl:element name="imageobject"> + <xsl:element name="imagedata"> + <xsl:attribute name="fileref"> + <xsl:text>images/</xsl:text><xsl:value-of select="text()"/><xsl:text>.png</xsl:text></xsl:attribute> + <xsl:attribute name="scale"> + <xsl:choose> + <xsl:when test="@scale != ''"> + <xsl:value-of select="@scale"/> + </xsl:when> + + <xsl:otherwise> + <xsl:text>50</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:attribute name="scalefit"><xsl:text>1</xsl:text></xsl:attribute> + </xsl:element> + </xsl:element> + <xsl:element name="imageobject"> + <xsl:attribute name="role"><xsl:text>latex</xsl:text></xsl:attribute> + <xsl:element name="imagedata"> + <xsl:attribute name="fileref"> + <xsl:value-of select="$latex.imagebasedir"/><xsl:text>images/</xsl:text><xsl:value-of select="text()"/></xsl:attribute> + </xsl:element> + </xsl:element> + + </xsl:element> + </xsl:template> + +</xsl:stylesheet> diff --git a/docs-xml/xslt/expand-smbconfdoc.xsl b/docs-xml/xslt/expand-smbconfdoc.xsl new file mode 100644 index 0000000..4e788ff --- /dev/null +++ b/docs-xml/xslt/expand-smbconfdoc.xsl @@ -0,0 +1,191 @@ +<?xml version='1.0'?> +<!-- + smb.conf-documentation specific stylesheets + Published under the GNU GPLv3 or later + + (C) Jelmer Vernooij 2002-2004 + (C) Alexander Bokovoy 2002-2004 +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:samba="http://www.samba.org/samba/DTD/samba-doc" + version="1.1"> + + <xsl:template match="description"><xsl:apply-templates/></xsl:template> + + <xsl:template match="value"><xsl:element name="literal"><xsl:apply-templates/></xsl:element></xsl:template> + + <xsl:template match="command"><xsl:element name="literal"><xsl:apply-templates/></xsl:element></xsl:template> + + <xsl:template match="synonym"><xsl:apply-templates/></xsl:template> + + <xsl:template match="related"><xsl:element name="para"><xsl:text>Related command</xsl:text><xsl:apply-templates/></xsl:element></xsl:template> + + <xsl:template match="samba:parameterlist"> + <xsl:apply-templates> + <xsl:sort select="samba:parameter/@name"/> + </xsl:apply-templates> + </xsl:template> + + <xsl:template match="value/comment"> + <xsl:text> # </xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="samba:parameter"> + <xsl:variable name="cname"><xsl:value-of select="translate(string(@name), + 'abcdefghijklmnopqrstuvwxyz ','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/> + </xsl:variable> + + <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable> + + <xsl:variable name="anchor"> + <xsl:element name="anchor"> + <xsl:attribute name="id"> + <xsl:value-of select="$cname"/> + </xsl:attribute> + </xsl:element> + </xsl:variable> + + <xsl:variable name="context"> + <xsl:text> (</xsl:text> + <xsl:value-of select="@context"/> + <xsl:text>)</xsl:text> + </xsl:variable> + + <xsl:variable name="term"> + <xsl:copy-of select="$anchor"/> + <xsl:element name="title"> + <xsl:text> </xsl:text> + <xsl:text> </xsl:text> + <xsl:value-of select="@name"/> + <xsl:value-of select="$context"/> + <xsl:text> </xsl:text> + </xsl:element> + </xsl:variable> + + + <!-- Generate list of examples --> + <xsl:variable name="examples"> + <xsl:for-each select="value"> + <xsl:if test="@type = 'example'"> + <xsl:element name="para"> + <xsl:text>Example: </xsl:text> + <xsl:element name="emphasis"> + <xsl:element name="parameter"> + <xsl:copy-of select="$name"/> + </xsl:element> + <xsl:text> = </xsl:text> + <xsl:apply-templates select="."/> + <xsl:text> </xsl:text> + </xsl:element> + <xsl:text> </xsl:text> + </xsl:element> + </xsl:if> + </xsl:for-each> + </xsl:variable> + + <xsl:variable name="tdefault"> + <xsl:for-each select="value"> + <xsl:if test="@type = 'default'"> + <xsl:element name="para"> + <xsl:text>Default: </xsl:text> + <xsl:element name="emphasis"> + <xsl:element name="parameter"> + <xsl:copy-of select="$name"/> + </xsl:element> + <xsl:text> = </xsl:text> + <xsl:apply-templates select="."/> + <xsl:text> </xsl:text> + </xsl:element> + <xsl:text> </xsl:text> + </xsl:element> + </xsl:if> + </xsl:for-each> + </xsl:variable> + + <xsl:variable name="default"> + <xsl:choose> + <xsl:when test="$tdefault = ''"> + <xsl:element name="para"> + <xsl:element name="emphasis"> + <xsl:text>No default</xsl:text> + </xsl:element> + </xsl:element> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="$tdefault"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="content"> + <xsl:apply-templates select="description"/> + </xsl:variable> + + <xsl:for-each select="synonym"> + <xsl:element name="section"> + <xsl:element name="indexterm"> + <xsl:attribute name="significance"> + <xsl:text>preferred</xsl:text> + </xsl:attribute> + <xsl:element name="primary"> + <xsl:value-of select="."/> + </xsl:element> + <xsl:element name="see"> + <xsl:value-of select="$name"/> + </xsl:element> + </xsl:element> + <xsl:element name="title"> + <xsl:text> </xsl:text> + <xsl:text> </xsl:text> + <xsl:element name="anchor"> + <xsl:attribute name="id"> + <xsl:value-of select="translate(string(.), 'abcdefghijklmnopqrstuvwxyz ','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/> + </xsl:attribute> + </xsl:element> + <xsl:value-of select="."/> + <xsl:text> </xsl:text> + </xsl:element> + <xsl:element name="variablelist"> + <xsl:element name="varlistentry"> + <xsl:element name="listitem"> + <xsl:element name="para"> + <xsl:text>This parameter is a synonym for </xsl:text> + <xsl:element name="link"> + <xsl:attribute name="linkend"> + <xsl:value-of select="translate(string($name), 'abcdefghijklmnopqrstuvwxyz ','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/> + </xsl:attribute> + <xsl:value-of select="$name"/> + </xsl:element> + <xsl:text>.</xsl:text> + </xsl:element> + </xsl:element> + </xsl:element> + </xsl:element> + <xsl:text> </xsl:text> + </xsl:element> + </xsl:for-each> + + <xsl:element name="section"> + <xsl:element name="indexterm"> + <xsl:attribute name="significance"> + <xsl:text>preferred</xsl:text> + </xsl:attribute> + <xsl:element name="primary"> + <xsl:value-of select="@name"/> + </xsl:element> + </xsl:element> + <xsl:copy-of select="$term"/> + <xsl:element name="variablelist"> + <xsl:element name="varlistentry"> + <xsl:element name="listitem"> + <xsl:copy-of select="$content"/> <xsl:text> </xsl:text> + <xsl:copy-of select="$default"/> <xsl:text> </xsl:text> + <xsl:copy-of select="$examples"/> <xsl:text> </xsl:text> + </xsl:element> + </xsl:element> + </xsl:element> + <xsl:text> </xsl:text> + </xsl:element> + </xsl:template> +</xsl:stylesheet> diff --git a/docs-xml/xslt/generate-attributions.xsl b/docs-xml/xslt/generate-attributions.xsl new file mode 100644 index 0000000..427a740 --- /dev/null +++ b/docs-xml/xslt/generate-attributions.xsl @@ -0,0 +1,84 @@ +<?xml version='1.0'?> +<!-- + Generate Docbook/XML file with attributions based on chapter/author tags + (C) Jelmer Vernooij 2003 + + Published under the GNU GPLv3 or later +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.1"> + +<xsl:output method="xml" doctype-public="-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" doctype-system="http://www.samba.org/samba/DTD/samba-doc" indent="yes"/> + +<!-- Remove all character data --> +<xsl:template match="@*|node()"> + <xsl:apply-templates select="@*|node()"/> +</xsl:template> + +<xsl:template match="/"> + <xsl:element name="preface"> + <xsl:element name="title"><xsl:text>Attribution</xsl:text></xsl:element> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<xsl:template match="chapter|preface"> + <xsl:choose> + <xsl:when test="chapterinfo/author != ''"> + <xsl:element name="para"> + <xsl:element name="link"> + <xsl:attribute name="linkend"><xsl:value-of select="@id"/></xsl:attribute> + <xsl:value-of select="title"/> + </xsl:element> + <xsl:text> 	</xsl:text> + <xsl:element name="itemizedlist"> + <xsl:apply-templates/> + <xsl:text>	</xsl:text> + </xsl:element> + <xsl:text> </xsl:text> + </xsl:element> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="chapterinfo/author"> + <xsl:choose> + <xsl:when test="firstname != ''"> + <xsl:text>	</xsl:text> + <xsl:element name="listitem"> + <xsl:element name="para"> + <xsl:value-of select="firstname"/> + <xsl:if test="othername != ''"> + <xsl:text> </xsl:text> + <xsl:value-of select="othername"/> + <xsl:text> </xsl:text> + </xsl:if> + <xsl:text> </xsl:text><xsl:value-of select="surname"/> + <xsl:choose> + <xsl:when test="affiliation/address/email != ''"> + <xsl:element name="ulink"> + <xsl:attribute name="noescape"> + <xsl:text>1</xsl:text> + </xsl:attribute> + <xsl:attribute name="url"> + <xsl:text>mailto:</xsl:text> + <xsl:value-of select="affiliation/address/email"/> + </xsl:attribute> + </xsl:element> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="contrib != ''"> + <xsl:text> (</xsl:text> + <xsl:value-of select="contrib"/> + <xsl:text>) </xsl:text> + </xsl:when> + </xsl:choose> + </xsl:element> + </xsl:element> + <xsl:text> </xsl:text> + </xsl:when> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> diff --git a/docs-xml/xslt/generate-dependencies.xsl b/docs-xml/xslt/generate-dependencies.xsl new file mode 100644 index 0000000..2fe3dd0 --- /dev/null +++ b/docs-xml/xslt/generate-dependencies.xsl @@ -0,0 +1,36 @@ +<?xml version='1.0'?> +<!-- + Find the image dependencies of a certain XML file + Generates (part of) a Makefile + + - $(FNAME)-images-latex-{png,eps,pdf} for role=latex + - $(FNAME)-images-role for all other roles + + (C) Jelmer Vernooij 2004-2005 + + Published under the GNU GPLv3 or later +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"> + <xsl:output method="text"/> + + <xsl:template match="/"> + <xsl:for-each select="//mediaobject/imageobject[@role and not(@role=following::imageobject/@role)]"> + <xsl:call-template name="generate-images"> + <xsl:with-param name="role"><xsl:value-of select="@role"/></xsl:with-param> + </xsl:call-template> + </xsl:for-each> + <xsl:call-template name="generate-images"> + <xsl:with-param name="role"/> + </xsl:call-template> + </xsl:template> + + <xsl:template name="generate-images"> + <xsl:param name="role"/> + <xsl:value-of select="$target"/><xsl:text>-images-</xsl:text><xsl:value-of select="$role"/><xsl:text> = </xsl:text> + <xsl:for-each select="//mediaobject/imageobject[@role=$role]"> + <xsl:value-of select="imagedata/@fileref"/> + <xsl:text> </xsl:text> + </xsl:for-each> + <xsl:text> </xsl:text> + </xsl:template> +</xsl:stylesheet> diff --git a/docs-xml/xslt/html-chunk.xsl b/docs-xml/xslt/html-chunk.xsl new file mode 100644 index 0000000..9598398 --- /dev/null +++ b/docs-xml/xslt/html-chunk.xsl @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + +<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/> +<xsl:import href="html-common.xsl"/> +<xsl:param name="chunk.first.sections" select="1"/> +<xsl:param name="chunk.quietly" select="0"/> +<xsl:param name="chunk.section.depth" select="0"/> +<xsl:param name="chunk.toc" select="''"/> +<xsl:param name="chunk.tocs.and.lots" select="0"/> + +</xsl:stylesheet> diff --git a/docs-xml/xslt/html-common.xsl b/docs-xml/xslt/html-common.xsl new file mode 100644 index 0000000..86d31a5 --- /dev/null +++ b/docs-xml/xslt/html-common.xsl @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xlink='http://www.w3.org/1999/xlink' + exclude-result-prefixes="xlink" + version="1.0"> + +<xsl:param name="base.dir" select="'../htmldocs/'"/> +<xsl:param name="bridgehead.in.toc" select="1"/> +<xsl:param name="citerefentry.link" select="'1'"/> +<xsl:param name="css.decoration" select="1"/> +<xsl:param name="html.stylesheet" select="'../samba.css'"/> +<xsl:param name="html.stylesheet.type">text/css</xsl:param> +<xsl:param name="use.extensions" select="'0'"/> +<xsl:param name="use.id.as.filename" select="'1'"/> +<xsl:param name="use.local.olink.style" select="1"/> +<xsl:param name="use.role.as.xrefstyle" select="1"/> +<xsl:param name="use.role.for.mediaobject" select="1"/> + +<xsl:template name="generate.citerefentry.link"> + <xsl:value-of select="refentrytitle"/><xsl:text>.</xsl:text><xsl:value-of select="manvolnum"/><xsl:text>.html</xsl:text> +</xsl:template> + +<xsl:template match="author"> +</xsl:template> + +<xsl:template match="link" name="link"> + <xsl:param name="linkend" select="@linkend"/> + <xsl:param name="a.target"/> + <xsl:param name="xhref" select="@xlink:href"/> + + <xsl:variable name="content"> + <xsl:call-template name="anchor"/> + <xsl:choose> + <xsl:when test="count(child::node()) > 0"> + <!-- If it has content, use it --> + <xsl:apply-templates/> + </xsl:when> + <!-- else look for an endterm --> + <xsl:when test="@endterm"> + <xsl:variable name="etargets" select="key('id',@endterm)"/> + <xsl:variable name="etarget" select="$etargets[1]"/> + <xsl:choose> + <xsl:when test="count($etarget) = 0"> + <xsl:message> + <xsl:value-of select="count($etargets)"/> + <xsl:text>Endterm points to nonexistent ID: </xsl:text> + <xsl:value-of select="@endterm"/> + </xsl:message> + <xsl:text>???</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="$etarget" mode="endterm"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="key('id', @linkend)/title[1]"> + <xsl:call-template name="gentext.startquote"/> + <xsl:value-of select="key('id', @linkend)/title[1]"/> + <xsl:call-template name="gentext.endquote"/> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>Link element has no content and no Endterm. And linkend's pointer has no title. </xsl:text> + <xsl:text>Nothing to show in the link to </xsl:text> + <xsl:value-of select="(@linkend)[1]"/> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:call-template name="simple.xlink"> + <xsl:with-param name="node" select="."/> + <xsl:with-param name="linkend" select="$linkend"/> + <xsl:with-param name="content" select="$content"/> + <xsl:with-param name="a.target" select="$a.target"/> + <xsl:with-param name="xhref" select="$xhref"/> + </xsl:call-template> + +</xsl:template> + +</xsl:stylesheet> diff --git a/docs-xml/xslt/html.xsl b/docs-xml/xslt/html.xsl new file mode 100644 index 0000000..b597b29 --- /dev/null +++ b/docs-xml/xslt/html.xsl @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + +<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/> +<xsl:import href="html-common.xsl"/> + +</xsl:stylesheet> diff --git a/docs-xml/xslt/html/samba.css b/docs-xml/xslt/html/samba.css new file mode 100644 index 0000000..3d926e8 --- /dev/null +++ b/docs-xml/xslt/html/samba.css @@ -0,0 +1,80 @@ +BODY { + font-family: helvetica, arial, lucida sans, sans-serif; + background-color: white; +} + +H1, H2, H3 { + color: blue; + font-size: 120%; + padding: 2px; + margin-top: 0px; +} + +H1 { + background-color: #EEEEFF; + color: blue; +} + +H2 { + background-color: #DDDDFF; + color: blue; +} + +H3 { + background-color: #CCCCFF; + color: blue; +} + +H4 { + color: blue; +} + +TR.qandadiv TD { + padding-top: 1em; +} + +DIV.navhead { + font-size: 80%; +} + +A:link { + color: #36F; +} + +A:visited { + color: #96C; +} + +A:active { + color: #F63; +} + +TR.question { + color: #33C; + font-weight: bold; +} + +TR.question TD { + padding-top: 1em; +} + +DIV.variablelist { + padding-left: 2em; + color: #33C; +} + +P { + color: black; +} + +DIV.note, DIV.warning, DIV.caution, DIV.tip, DIV.important { + border: dashed 1px; + background-color: #EEEEFF; + width: 40em; +} + +PRE.programlisting, PRE.screen { + border: #630 1px dashed; + color: #630; +} + diff --git a/docs-xml/xslt/latex.overrides.xml b/docs-xml/xslt/latex.overrides.xml new file mode 100644 index 0000000..76943b0 --- /dev/null +++ b/docs-xml/xslt/latex.overrides.xml @@ -0,0 +1,9 @@ +<?xml version='1.0'?> +<latexbindings> + <latexmapping role="begin"> + </latexmapping> + <latexmapping role="end"> + <mapping key="glossary" text=""/> + <mapping key="index" text=""/> + </latexmapping> +</latexbindings> diff --git a/docs-xml/xslt/latex.xsl b/docs-xml/xslt/latex.xsl new file mode 100644 index 0000000..5bc6deb --- /dev/null +++ b/docs-xml/xslt/latex.xsl @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0' + xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"> + + <!-- Remove bits from the manual pages that are not relevant for the HOWTO Collection, + such as author info, etc --> + <xsl:import href="strip-references.xsl"/> + + <!-- Handle Samba-specific elements --> + <xsl:import href="latex/samba.xsl"/> + + <xsl:param name="latex.mapping.xml" select="document('latex.overrides.xml')"/> + +<xsl:param name="generate.toc"> + /appendix toc,title + article/appendix nop + /article toc,title + book toc,title,figure,table,example,equation + /chapter toc,title,lop + part toc,title + /preface toc,title + qandadiv toc + qandaset toc + procedure lop + reference toc,title + /sect1 toc + /sect2 toc + /sect3 toc + /sect4 toc + /sect5 toc + /section toc + set toc,title +</xsl:param> + +<xsl:output method="text" encoding="UTF-8" indent="yes"/> +<xsl:variable name="l10n.gentext.default.language" select="'en'"/> +<xsl:variable name="latex.example.caption.style"></xsl:variable> +<xsl:variable name="latex.hyperref.param.pdftex">hyperfigures,hyperindex,citecolor=black,urlcolor=black,filecolor=black,linkcolor=black,menucolor=red,pagecolor=black</xsl:variable> +<xsl:variable name="latex.use.tabularx">1</xsl:variable> +<xsl:variable name="latex.use.parskip">1</xsl:variable> +<xsl:variable name="latex.hyphenation.tttricks">1</xsl:variable> +<xsl:template name="latex.thead.row.entry"> +<xsl:text>{\bfseries </xsl:text><xsl:apply-templates/><xsl:text>}</xsl:text> +</xsl:template> +<!-- +<xsl:variable name="latex.class.book">sambadoc</xsl:variable> +--> +<xsl:variable name="latex.babel.language">english</xsl:variable> +<xsl:variable name="ulink.footnotes" select="1"/> +<xsl:variable name="ulink.show" select="0"/> + +<!-- The 'imagefile' element, so we can use images without three layers of XML elements --> +<xsl:template match="imagefile"> + <xsl:text>\includegraphics[scale=</xsl:text> + <xsl:choose> + <xsl:when test="@scale != ''"><xsl:value-of select="@scale div 100"/></xsl:when> + + <xsl:otherwise><xsl:text>.50</xsl:text></xsl:otherwise> + </xsl:choose> + <xsl:text>]{</xsl:text> + <xsl:value-of select="text()"/> + <xsl:text>} </xsl:text> +</xsl:template> +</xsl:stylesheet> diff --git a/docs-xml/xslt/latex/samba.sty b/docs-xml/xslt/latex/samba.sty new file mode 100644 index 0000000..a576898 --- /dev/null +++ b/docs-xml/xslt/latex/samba.sty @@ -0,0 +1,25 @@ +% LaTeX class with Samba-specific commands +% Copyright (C) 2004 Jelmer Vernooij <jelmer@samba.org> +% Released under the GNU GPL v3 or later + +\newcommand{\smbconfsection}[1]{\emph{#1}} +\newcommand{\smbconfoption}[1]{\index{#1}\emph{#1}} +% smb.conf syntax highlighting +\RequirePackage{listings} +\RequirePackage{xcolor} + +\lstdefinelanguage{smbconf}{ + morecomment=[l]{\#}, +} + +\lstdefinestyle{smbconfblock} +{ + breaklines=true, + backgroundcolor=\color[gray]{0.93}, + frame=single, + frameround=tttt, + prebreak={\space\linebreaksign}, + basicstyle=\small +} + +\newcommand{\linebreaksign}{\hbox{\ensuremath\hookleftarrow}} diff --git a/docs-xml/xslt/latex/samba.xsl b/docs-xml/xslt/latex/samba.xsl new file mode 100644 index 0000000..9fc27e6 --- /dev/null +++ b/docs-xml/xslt/latex/samba.xsl @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + Expand Samba-specific XML elements to LaTeX, for use with dblatex + + Copyright (C) 2003,2004,2009 Jelmer Vernooij <jelmer@samba.org> + Published under the GNU GPLv3 or later +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0' + xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"> + +<!-- FIXME: dblatex should have some way to load additional packages, user.params.set2 + isn't really meant for this sort of thing --> +<xsl:template name="user.params.set2"> + <xsl:text>\usepackage{samba} </xsl:text> +</xsl:template> + +<xsl:template match="smbconfblock/smbconfoption"> + <xsl:text> </xsl:text><xsl:value-of select="@name"/> + <xsl:if test="text() != ''"> + <xsl:text> = </xsl:text> + <xsl:value-of select="text()"/> + </xsl:if> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="smbconfblock/smbconfcomment"> + <xsl:text># </xsl:text> + <xsl:apply-templates/> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="smbconfblock/smbconfsection"> + <xsl:value-of select="@name"/> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="smbconfoption"> + <xsl:text>\smbconfoption{</xsl:text> + <xsl:call-template name="scape"> + <xsl:with-param name="string" select="@name"/> + </xsl:call-template> + <xsl:text>}</xsl:text> + + <xsl:choose> + <xsl:when test="text() != ''"> + <xsl:text> = </xsl:text> + <xsl:call-template name="scape"> + <xsl:with-param name="string" select="text()"/> + </xsl:call-template> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="smbconfblock"> + <xsl:text> \begin{lstlisting}[language=smbconf,style=smbconfblock] </xsl:text> + <xsl:apply-templates/> + <xsl:text>\end{lstlisting} </xsl:text> +</xsl:template> + +<xsl:template match="smbconfsection"> + <xsl:text>\smbconfsection{</xsl:text> + <xsl:call-template name="scape"> + <xsl:with-param name="string" select="@name"/> + </xsl:call-template> + <xsl:text>}</xsl:text> +</xsl:template> + + +<xsl:template match="description"><xsl:apply-templates/></xsl:template> + +<xsl:template match="value"><xsl:apply-templates/></xsl:template> + +<xsl:template match="synonym"><xsl:apply-templates/></xsl:template> + +<xsl:template match="related"><xsl:apply-templates/></xsl:template> + +<xsl:template match="//samba:parameterlist"> + <xsl:text>\begin{description} </xsl:text> + <xsl:apply-templates> + <xsl:sort select="samba:parameter/@name"/> + </xsl:apply-templates> + <xsl:text>\end{description} </xsl:text> +</xsl:template> + +<xsl:template match="value/comment"> + <xsl:text> # </xsl:text> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="/"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="refentry"> + <xsl:text>\section{</xsl:text><xsl:value-of select="refmeta/refentrytitle"/><xsl:text>} </xsl:text> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="//samba:parameter"> + <xsl:for-each select="synonym"> + <xsl:text>\item[{</xsl:text><xsl:value-of select="."/><xsl:text>}]\null{} </xsl:text> + <xsl:text>\index{</xsl:text><xsl:value-of select="."/><xsl:text>} </xsl:text> + <xsl:text>This parameter is a synonym for \smbconfoption{</xsl:text><xsl:value-of select="../@name"/><xsl:text>}.</xsl:text> + </xsl:for-each> + + <xsl:text>\item[{</xsl:text><xsl:value-of select="@name"/> + <xsl:text> (</xsl:text> + <xsl:value-of select="@context"/> + <xsl:text>)</xsl:text> + <xsl:text>}]\null{} </xsl:text> + <xsl:text>\index{</xsl:text><xsl:value-of select="@name"/><xsl:text>} </xsl:text> + + <!-- Print default value--> + <xsl:text> </xsl:text> + <xsl:text>Default: </xsl:text> + <xsl:text>\emph{</xsl:text> + <xsl:choose> + <xsl:when test="value[@type='default'] != ''"> + <xsl:value-of select="@name"/> + <xsl:text> = </xsl:text> + <xsl:apply-templates select="value"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>No default</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:text>}</xsl:text> + <xsl:text> </xsl:text> + + <!-- Generate list of examples --> + <xsl:text> </xsl:text> + <xsl:for-each select="value[@type='example']"> + <xsl:text> </xsl:text> + <xsl:text>Example: </xsl:text> + <xsl:text>\emph{</xsl:text><xsl:value-of select="../@name"/> + <xsl:text> = </xsl:text> + <xsl:apply-templates select="."/> + <xsl:text>}</xsl:text> + <xsl:text> </xsl:text> + </xsl:for-each> + + <!-- Description --> + <xsl:apply-templates select="description"/> +</xsl:template> + +</xsl:stylesheet> diff --git a/docs-xml/xslt/latex/sambadoc.cls b/docs-xml/xslt/latex/sambadoc.cls new file mode 100644 index 0000000..b7f634f --- /dev/null +++ b/docs-xml/xslt/latex/sambadoc.cls @@ -0,0 +1,324 @@ +% $Id$ +% phstyle.cls -- Macros for formatting Prentice-Hall Books +% -- Compiled by J.K. Shultis, Dec. 1993 +% -- Modified and enhanced for LaTeX2e mdh/rlm 1997/02 +% -- Style Modifications Lori Hughes June 2002 +% -- Modifications for Samba by Jelmer Vernooij 2003-2005 + +\NeedsTeXFormat{LaTeX2e}% +\ProvidesClass{sambadoc}[2005/06/13 Samba Documentation class] +\newif\if@ph +\@phfalse +\DeclareOption{ph}{ \@phtrue } +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}} +\ProcessOptions% + +% Base everything on the default class 'report'. +\LoadClass{report}% +%================================================================================ +% 1. Page layout dimensions +% 3. Define new fonts for headings +% 4. Redefines the way "figure" amd "table" are formatted in a \caption +% 5. Defines a \capt macro which defines (1) \captwidth, (2) \captsize +% and \beforetableskip. +% 6. Defines and modifies FANCYHDS.STY for headers and foots +% 7. Change sectioning headings to bold sans serif fonts +% 8. Turn off leader dots in Table of Contents +%====================================================================== + +%====================== Page Layout +% \oddsidemargin 0.750in \evensidemargin 0.750in \textwidth 5.00in +% \topmargin 0.625in \headheight 0.3in \headsep 0.2in +% \textheight 7.3in %\footheight .2in +% \footskip 0.3in +% \parskip 0ex \marginparwidth 1.00in \marginparsep 0.5in +%\setlength\arraycolsep{1pt} + +\if@ph + \RequirePackage{geometry} + \geometry{ + twoside, + openleft, + papersize={7in,9.25in}, + lmargin=.75in, + rmargin=.75in, + bmargin=.625in, + tmargin=.825in, + width=5.5in, + height=7.325in, + marginparwidth=0.35in, + headheight=0.2in, + textwidth=5in, + headsep=.25in, + footskip=.025in} + %\usepackage[letter,cam,cross,center]{crop} +\fi + +%====================== Define special fonts +\newfont{\BIG}{cminch} %--- One-inch font +\newfont{\sfbHuge}{cmssbx10 scaled\magstep5} %-- 25pt sans serif bold +\newfont{\sfblarge}{cmssbx10 scaled\magstep1} %-- 12pt sans serif bold +\newfont{\sfbeleven}{cmssbx10 scaled\magstephalf} %-- 11pt sans serif bold +\newfont{\sfb}{cmssbx10} %-- 10pt sans serif bold +\newfont{\sfeight}{cmss8} %-- 8pt sans serif +\newfont{\sfnine}{cmss8 at 9pt} %-- 9pt sans serif + +\newfont{\defnem}{cmbxti10} %-- 10pt sans serif bold +\def\spacingset#1{\def\baselinestretch{#1}\small\normalsize} + +%-----------Change section heading font sizes here---- +\newfont{\sfbsection}{cmssbx10 at 13pt} +\newfont{\sfbsubsec}{cmssbx10 at 12pt} +\newfont{\sfbsubsub}{cmssbx10 at 11pt} +\newfont{\sfbpara}{cmssbx10} +%--------------------------------------------------- + + +% +% Theorem hack +% + +\def\@begintheorem#1#2{\trivlist + \item[\hskip \labelsep{\bfseries #1\ #2:}]\itshape} + +%===================== Redefine the \@makecaption command + \long\def\@makecaption#1#2{\vskip 10\p@ +%% \setbox\@tempboxa\hbox{#1: #2}% %% original label definition + \setbox\@tempboxa\hbox{\textbf{ \small #1.} \small #2}% %% bold and . instead of : + \ifdim \wd\@tempboxa >\hsize +%% #1: #2\par %% original definition + \textbf{ \small #1.} \small #2\par %% bold and . instead of : + \else + \hbox to\hsize{\hfil\box\@tempboxa\hfil}% %% original +%% \hbox to\hsize{\box\@tempboxa\hfil}% %% no centering + \fi} + +%===================== New caption macro +\newlength{\captsize} \let\captsize=\footnotesize +\newlength{\captwidth} \setlength{\captwidth}{\textwidth} +\newlength{\beforetableskip} \setlength{\beforetableskip}{.5\baselineskip} +\newcommand{\capt}[1]{\begin{minipage}{\captwidth} + \let\normalsize=\captsize + \caption[#1]{#1} + \end{minipage}\\ \vspace{\beforetableskip}} + + +%---------- Change Figure Label +\newcommand{\thefigurename}{Figure} %-- set default: Figure +\def\fnum@figure{\thefigurename\ \thefigure} + +% This is to get the equation numbers in the form (section.equation), +% and to have the equation counter reset every time the section +% counter is incremented. + +\def\theequation{\thechapter.\arabic{equation}} +\@addtoreset{equation}{chapter} + +\RequirePackage{fancyhdr} + +%------------------- Modify Headers for Prentice-Hall Book Style +%---------- Setup headers and footers +\pagestyle{fancyplain} + +%--- Redefine Headers +\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} +% +\lhead[\fancyplain{}{\bf\thepage}]{\fancyplain{}{\sfnine\rightmark}} +% +%\rhead[\fancyplain{}{\footnotesize\sf\CHHEAD}]{\fancyplain{}{\bf\thepage}} + \rhead[\fancyplain{}{\sfnine \leftmark}]{\fancyplain{}{\bf\thepage}} +%--- Empty footers on every page (except initial chapter page which has +%--- page number) and optionally a small date stamp +\cfoot[\fancyplain{}{}]{\fancyplain{}{}} +\rfoot[\fancyplain{}{}]{\fancyplain{\hspace{\fill}\\ \bf\thepage}{}} +\lfoot[\fancyplain{\hspace{\fill}\\ \bf\thepage}{}]{\fancyplain{}{}} +%-- replace the two lines above with the two below for a date stamp footer +%\rfoot[\fancyplain{\scriptsize \today}{\scriptsize \today}]{\fancyplain{\bf\thepage}{}} +%\lfoot[\fancyplain{\bf\thepage}{}]{\fancyplain{\scriptsize \today}{\scriptsize \today}} +%--- Change format of section header +% +% rlm added chaptermark 10/11/96 +\def\sectionmark#1{\markright{\ifnum \c@secnumdepth >\z@ + {\sfeight Section}~\thesection.\quad \fi #1}} +\def\sectionsmark#1{\markright{#1}{#1}} +% +\def\chaptermark#1{\markboth{#1 \quad \@chapapp{}~\thechapter}{}} +\def\chaptersmark#1{\markboth{#1}{#1}} + + +%===================== Change Section Heads to Bold Sans Serif +% Create bolds sans serif sectioning headings. Also the headings have +% been reduced in size with less space before and after the heading. +% Modified from macros given in BK10.STY +% +%----------------------------- part --------------------------------- +\def\@part[#1]#2{% + \thispagestyle{empty} + \ifodd\c@page\hbox{}\else\clearpage\fi + \addtocounter{page}{-2} + \thispagestyle{empty} + \ifnum \c@secnumdepth >-2\relax + \refstepcounter{part}% + \addcontentsline{toc}{part}{Part \thepart\hspace{1em}#1}% + \else + \addcontentsline{toc}{part}{Part #1}% + \fi + {\centering + \interlinepenalty \@M + \normalfont + \ifnum \c@secnumdepth >-2\relax + \huge\bfseries \partname\nobreakspace\thepart + \par + \vskip 20\p@ + \fi + \Huge \bfseries #2\par}% + \@endpart} + +%------------------------- appendix ----------------------------------- + +\let\oldappendix\appendix +\def\appendix{\oldappendix\def\addchaptertoloe{}} + +%------------------------- chapter ----------------------------------- +\def\addchaptertoloe{% + \addtocontents{loe}{\protect\addvspace{14pt}}% + \addtocontents{loe}{\noindent {\bfseries Chapter~\thechapter}\protect\par}% + \addtocontents{loe}{\protect\addvspace{10pt}}% +} + +\def\chapter{\clearpage \thispagestyle{plain} \global\@topnum\z@ +\@afterindentfalse \secdef\@chapter\@schapter} +\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne + \refstepcounter{chapter} + \typeout{\@chapapp\space\thechapter.} + \addcontentsline{toc}{chapter}{Chapter~\protect + \numberline{\thechapter}\uppercase{#1}}\else + \addcontentsline{toc}{chapter}{Chapter~\uppercase{#1}}\fi + \chaptermark{#1} + \addchaptertoloe + \addtocontents{lof}{\protect\addvspace{10pt}} +\addtocontents{lot}{\protect\addvspace{10pt}} \if@twocolumn +\@topnewpage[\@makechapterhead{#2}] + \else \@makechapterhead{#2} + \@afterheading \fi} +% +\def\@schapter#1{\if@twocolumn \@topnewpage[\@makeschapterhead{#1}] + \else \@makeschapterhead{#1}\chaptersmark{#1} + \@afterheading\fi\addcontentsline{toc}{chapter}{\uppercase{#1}}} + + + +\def\@makechapterhead#1{\vspace*{-20pt}{\parindent0pt\raggedright +\ifnum\c@secnumdepth>\m@ne\LARGE\sf\@chapapp{}~\thechapter\par +\vskip3pt\hrule\vskip3pt\hrule +\vskip30pt\fi\raggedright\Huge\sfbHuge\uppercase{#1}\par +\nobreak\vskip70pt}}%\chaptermark{#1}} + +\def\@makeschapterhead#1{\vspace*{4pt}{\parindent0pt +\vskip3pt\hrule\vskip3pt\hrule +\vskip36pt\raggedright\Huge\sfbHuge\uppercase{#1}\par +\nobreak\vskip70pt}}%\chaptersmark{#1}} +\widowpenalty=1000 +\clubpenalty=1000 + +%------------------------ section ----------------------------------- +\def\section{\@startsection{section}{1}{\z@}{-3.5ex plus-1ex + minus -.2ex}{1.8ex}{\sfbsection}} + +%--------------------- subsection ----------------------------------- +\def\subsection{\@startsection{subsection}{2}{\z@}{-2.75ex plus -1ex + minus -.2ex}{1.2ex}{\sfbsubsec}} + +%-------------------- subsubsection -------------------------------- +\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-2.75ex + plus -1ex minus -.2ex}{1.2ex}{\sfbsubsub}} + +%----------------------- paragraph ---------------------------------- +\def\paragraph{\@startsection{paragraph}{4}{\z@}{1.25ex plus + 1ex minus .2ex}{-1em}{\sfbpara}} + +%---------------------- subparagraph -------------------------------- +\def\subparagraph{\@startsection{subparagraph}{4}{\parindent}{1.25ex + plus 1ex minus .2ex}{-1em}{\normalsize\sfb}} + + + +%====================== Turn off leader dots in Table of Contents +\renewcommand{\@dotsep}{500} + +\def\tableofcontents{\markboth{}{}\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn + \fi\thispagestyle{plain} \@makeschapterhead{Contents} + \@afterheading + \chaptersmark{Contents} + \sectionsmark{Contents} + \@starttoc{toc}\if@restonecol\twocolumn\fi} + + +\def\thebibliography#1{\chapter*{Bibliography}\list +% \addcontentsline{toc}{chapter}{Bibliography} + {[\arabic{enumi}]}{\settowidth\labelwidth{2em}\leftmargin\labelwidth +% \advance\leftmargin\labelsep + \usecounter{enumi}} + \def\newblock{\hskip .11em plus .33em minus .07em} + \sloppy\clubpenalty4000\widowpenalty4000 + \sfcode`\.=1000\relax} +\let\endthebibliography=\endlist + + +%% BIBLIOGRAPHY +% +%% separate citations with "], [" +\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi +\def\@citea{}\@cite{\@for\@citeb:=#2\do {\@citea\def\@citea{], +[}\@ifundefined {b@\@citeb}{{\bf ?}\@warning {Citation `\@citeb' on +page \thepage \space undefined}}% +{\csname b@\@citeb\endcsname}}}{#1}} + +\def\@cite#1#2{[{#1\if@tempswa, #2\fi}]} + + +%% index + +\def\theindex{\cleardoublepage\@restonecoltrue\if@twocolumn\@restonecolfalse\fi +\columnseprule \z@ +\columnsep 35pt\twocolumn[\@makeschapterhead{Subject Index}] + \chaptersmark{Subject Index}% + \addcontentsline{toc}{chapter}{SUBJECT INDEX} + \thispagestyle{plain}\parindent\z@ + \parskip\z@ plus .3pt\relax\let\item\@idxitem} + + +\renewcommand{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else +\hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi} + +\renewcommand{\numberline}[1]{\sbox\@tempboxa{#1\hspace{2pt}}% + \ifdim\wd\@tempboxa>\@tempdima \else \wd\@tempboxa\@tempdima\fi + \box\@tempboxa} + +% Custom list of examples +\def\listofexamples{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn + \fi\chapter*{List of Examples} + \renewcommand\@pnumwidth{0em} + \@starttoc{loe}\if@restonecol + \twocolumn\fi} + +\def\l@example{\noindent\@dottedtocline{1}{0em}{3.5em}} + +\renewcommand\listfigurename{\uppercase{List Of Figures}} +\renewcommand\listtablename{\uppercase{List Of Tables}} + +\setlength{\emergencystretch}{0cm} + + +\cleardoublepage +\pagenumbering{roman} + +\setcounter{page}{2} +\setcounter{totalnumber}{8} +\setcounter{bottomnumber}{3} +\setcounter{topnumber}{3} +\renewcommand{\textfraction}{0.1} +\renewcommand{\topfraction}{1.0} +\renewcommand{\bottomfraction}{1.0} + +\RequirePackage{samba} diff --git a/docs-xml/xslt/man.xsl b/docs-xml/xslt/man.xsl new file mode 100644 index 0000000..e252b56 --- /dev/null +++ b/docs-xml/xslt/man.xsl @@ -0,0 +1,89 @@ +<?xml version='1.0'?> +<!-- vim:set sts=2 shiftwidth=2 syntax=xml: --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xlink='http://www.w3.org/1999/xlink' + version='1.0'> + +<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/> + +<xsl:param name="chunk.section.depth" select="0"/> +<xsl:param name="chunk.first.sections" select="1"/> +<xsl:param name="use.id.as.filename" select="1"/> +<xsl:param name="man.endnotes.are.numbered" select="0"/> + +<!-- + Our ulink stylesheet omits @url part if content was specified +--> +<xsl:template match="ulink"> + <xsl:variable name="content"> + <xsl:apply-templates/> + </xsl:variable> + <xsl:if test="$content = ''"> + <xsl:text>: </xsl:text> + </xsl:if> + <xsl:if test="$content != ''"> + <xsl:value-of select="$content" /> + </xsl:if> + <xsl:if test="$content = ''"> + <xsl:apply-templates mode="italic" select="@url" /> + </xsl:if> +</xsl:template> + +<xsl:template match="itemizedlist|orderedlist|procedure"> + <xsl:if test="title"> + <xsl:text>.PP </xsl:text> + <xsl:call-template name="bold"> + <xsl:with-param name="node" select="title"/> + <xsl:with-param name="context" select="."/> + </xsl:call-template> + <xsl:text> </xsl:text> + </xsl:if> + <!-- * DocBook allows just about any block content to appear in --> + <!-- * lists before the actual list items, so we need to get that --> + <!-- * content (if any) before getting the list items --> + <xsl:apply-templates + select="*[not(self::listitem) and not(self::title)]"/> + <xsl:text> .RS </xsl:text> + <xsl:apply-templates select="listitem"/> + <xsl:if test="(parent::para or parent::listitem) or following-sibling::node()"> + <xsl:text>.sp </xsl:text> + <xsl:text>.RE </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="refsect3"> + <xsl:text> .SS "</xsl:text> + <xsl:value-of select="title[1]"/> + <xsl:text>" </xsl:text> + <xsl:apply-templates/> +</xsl:template> + + <!-- ================================================================== --> + <!-- These macros are from Docbook manpages XSLT development tree --> + <!-- help to maintain manpage generation clean when difference between --> + <!-- roff processors is important to note. --> + + <xsl:template name="roff-if-else-start"> + <xsl:param name="condition">n</xsl:param> + <xsl:text>.ie </xsl:text> + <xsl:value-of select="$condition"/> + <xsl:text> \{\ </xsl:text> + </xsl:template> + + <xsl:template name="roff-if-start"> + <xsl:param name="condition">n</xsl:param> + <xsl:text>.if </xsl:text> + <xsl:value-of select="$condition"/> + <xsl:text> \{\ </xsl:text> + </xsl:template> + + <xsl:template name="roff-else"> + <xsl:text>.\} </xsl:text> + <xsl:text>.el \{\ </xsl:text> + </xsl:template> + + <xsl:template name="roff-if-end"> + <xsl:text>.\} </xsl:text> + </xsl:template> + +</xsl:stylesheet> diff --git a/docs-xml/xslt/manpage-summary.xsl b/docs-xml/xslt/manpage-summary.xsl new file mode 100644 index 0000000..59bf6dc --- /dev/null +++ b/docs-xml/xslt/manpage-summary.xsl @@ -0,0 +1,42 @@ +<?xml version='1.0'?> +<!-- + Generate a summary page with a list of links to all manual pages + + Copyright (C) 2004 Jelmer Vernooij <jelmer@samba.org> + Published under the GNU GPLv3 or later +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:exsl="http://exslt.org/common" + version="1.1"> + + <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="yes"/> + + <xsl:template match="refentry"> + <xsl:element name="varlistentry"> + <xsl:apply-templates/> + </xsl:element> + </xsl:template> + + <xsl:template match="refentry/refmeta"> + <xsl:element name="term"> + <xsl:element name="ulink"> + <xsl:attribute name="url"> + <xsl:value-of select="refentrytitle"/><xsl:text>.</xsl:text><xsl:value-of select="manvolnum"/><xsl:text>.html</xsl:text> + </xsl:attribute> + <xsl:value-of select="refentrytitle"/><xsl:text>(</xsl:text><xsl:value-of select="manvolnum"/><xsl:text>)</xsl:text> + </xsl:element> + </xsl:element> + </xsl:template> + + <xsl:template match="refentry/refnamediv"> + <xsl:element name="listitem"> + <xsl:element name="para"> + <xsl:value-of select="refpurpose"/><xsl:text> </xsl:text> + </xsl:element> + </xsl:element> + </xsl:template> + + <xsl:template match="@*|node()"> + <xsl:apply-templates/> + </xsl:template> +</xsl:stylesheet> diff --git a/docs-xml/xslt/sambadoc2pearson.xsl b/docs-xml/xslt/sambadoc2pearson.xsl new file mode 100644 index 0000000..6100889 --- /dev/null +++ b/docs-xml/xslt/sambadoc2pearson.xsl @@ -0,0 +1,82 @@ +<?xml version='1.0'?> +<!-- + Convert DocBook to XML validating against the Pearson DTD + + (C) Jelmer Vernooij <jelmer@samba.org> 2004 + + Released under the GNU GPLv3 or later +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + exclude-result-prefixes="doc" + version="1.1" > + + <xsl:import href="docbook2pearson.xsl"/> + + <xsl:strip-space elements="smbconfoption smbconfsection"/> + + <xsl:template match="smbconfblock/smbconfsection"> + <xsl:text> </xsl:text> + <xsl:value-of select="."/><xsl:text> </xsl:text> + </xsl:template> + + <xsl:template match="smbconfblock/smbconfoption"> + <xsl:text> </xsl:text><xsl:value-of select="@name"/><xsl:text> = </xsl:text><xsl:value-of select="text()"/><xsl:text> </xsl:text> + </xsl:template> + + <xsl:template match="smbconfblock"> + <xsl:call-template name="transform.id.attribute"/> + <listingcode> + <xsl:apply-templates/> + </listingcode> + </xsl:template> + + <xsl:template match="image"> + <figure> + <xsl:call-template name="transform.id.attribute"/> + <description><xsl:value-of select="imagedescription"/></description> + <figureref> + <xsl:attribute name="fileref"> + <xsl:value-of select="imagefile"/> + </xsl:attribute> + <xsl:if test="@scale != ''"> + <xsl:attribute name="scale"> + <xsl:value-of select="@scale"/> + </xsl:attribute> + </xsl:if> + </figureref> + </figure> + </xsl:template> + + <xsl:template match="smbconfblock/smbconfcomment"> + <xsl:text># </xsl:text><xsl:value-of select="text()"/><xsl:text> </xsl:text> + </xsl:template> + + <xsl:template match="smbconfblock/member"> + <xsl:value-of select="text()"/><xsl:text> </xsl:text> + <xsl:message><xsl:text>Encountered <member> element inside of smbconfblock!</xsl:text></xsl:message> + </xsl:template> + + <xsl:template match="filterline"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="smbconfoption"> + <code><xsl:value-of select="@name"/></code> + <xsl:if test="text() != ''"> + <xsl:text> = </xsl:text> + <xsl:value-of select="text()"/> + </xsl:if> + <xsl:text> </xsl:text> + </xsl:template> + + <xsl:template match="smbconfsection"> + <code><xsl:apply-templates/></code> + </xsl:template> + + <xsl:template match="ntgroup|ntuser"> + <em><xsl:apply-templates/></em> + </xsl:template> + <!-- translator --> + +</xsl:stylesheet> diff --git a/docs-xml/xslt/smb.conf-html.xsl b/docs-xml/xslt/smb.conf-html.xsl new file mode 100644 index 0000000..fe1a1cc --- /dev/null +++ b/docs-xml/xslt/smb.conf-html.xsl @@ -0,0 +1,103 @@ +<?xml version='1.0'?> +<!-- + Samba-documentation specific stylesheets + Published under the GNU GPLv3 or later + + (C) Jelmer Vernooij 2005 +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:exsl="http://exslt.org/common" + xmlns:samba="http://www.samba.org/samba/DTD/samba-doc" + version="1.1" + extension-element-prefixes="exsl"> + + <xsl:import href="html-common.xsl"/> + + <xsl:output method="xml" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" indent="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/> + + <xsl:template match="samba:parameter"> + <xsl:element name="html"> + <xsl:element name="head"> + <xsl:element name="link"> + <xsl:attribute name="href"><xsl:text>smb.conf.xsl</xsl:text></xsl:attribute> + <xsl:attribute name="rel"><xsl:text>stylesheet</xsl:text></xsl:attribute> + <xsl:attribute name="type"><xsl:text>text/css</xsl:text></xsl:attribute> + </xsl:element> + + <xsl:element name="title"> + <xsl:value-of select="@name"/> + </xsl:element> + </xsl:element> + <xsl:element name="body"> + <xsl:element name="h1"> + <xsl:value-of select="@name"/> + </xsl:element> + + <xsl:element name="div"> + <xsl:attribute name="class"><xsl:text>context</xsl:text></xsl:attribute> + <xsl:text>Context: </xsl:text> + <xsl:choose> + <xsl:when test="@context = 'S'"> + <xsl:text>Share-specific</xsl:text> + </xsl:when> + + <xsl:when test="@context = 'G'"> + <xsl:text>Global</xsl:text> + </xsl:when> + + <xsl:otherwise> + <xsl:message><xsl:text>Unknown value for context attribute : </xsl:text><xsl:value-of select="@context"/></xsl:message> + </xsl:otherwise> + </xsl:choose> + + </xsl:element> + + <xsl:element name="div"> + <xsl:attribute name="class"><xsl:text>type</xsl:text></xsl:attribute> + <xsl:text>Type: </xsl:text> + <xsl:value-of select="@type"/> + </xsl:element> + + <xsl:element name="div"> + <xsl:attribute name="class"><xsl:text>synonyms</xsl:text></xsl:attribute> + <xsl:text>Synonyms: </xsl:text> + <xsl:for-each select="synonym"> + <xsl:text>, </xsl:text> + <xsl:value-of select="text()"/> + </xsl:for-each> + </xsl:element> + + <xsl:for-each select="value"> + <xsl:element name="div"> + <xsl:attribute name="class"><xsl:text>value</xsl:text></xsl:attribute> + <xsl:choose> + <xsl:when test="@type = 'default'"> + <xsl:text>Default value</xsl:text> + </xsl:when> + <xsl:when test="@type = 'example'"> + <xsl:text>Example value</xsl:text> + </xsl:when> + </xsl:choose> + + <xsl:text>: </xsl:text> + + <xsl:value-of select="text()"/> + + </xsl:element> + </xsl:for-each> + + <xsl:element name="div"> + <xsl:attribute name="class"><xsl:text>description</xsl:text></xsl:attribute> + + <xsl:for-each select="description"> + <xsl:apply-templates/> + </xsl:for-each> + </xsl:element> + </xsl:element> + </xsl:element> + </xsl:template> + + <xsl:template match="description"> + <xsl:apply-templates/> + </xsl:template> +</xsl:stylesheet> diff --git a/docs-xml/xslt/strip-references.xsl b/docs-xml/xslt/strip-references.xsl new file mode 100644 index 0000000..56b782a --- /dev/null +++ b/docs-xml/xslt/strip-references.xsl @@ -0,0 +1,8 @@ +<?xml version='1.0'?> +<!-- Removes particular (useless for the book) elements from references --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.1"> + <xsl:template match="reference/refentry/refsect1[title='VERSION' or title='AUTHOR']"/> + <xsl:template match="reference/refentry/refmeta"/> + <xsl:template match="reference/refentry/refnamediv"/> +</xsl:stylesheet> diff --git a/docs-xml/xslt/yodl.xsl b/docs-xml/xslt/yodl.xsl new file mode 100644 index 0000000..d33cdd6 --- /dev/null +++ b/docs-xml/xslt/yodl.xsl @@ -0,0 +1,321 @@ +<?xml version='1.0'?> +<!-- + DocBook to yodl converter + + Lacks support for a few docbook tags, but pretty much all + yodl macros are used + + (C) Jelmer Vernooij 2004 + Published under the GNU GPLv3 or later +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:exsl="http://exslt.org/common" + version="1.1"> + + <xsl:output method="text" encoding="iso-8859-1" standalone="yes" indent="no"/> + <xsl:strip-space elements="*"/> + + <xsl:template match="refentry"> + <xsl:text>manpage(</xsl:text> + <xsl:value-of select="refmeta/refentrytitle"/> + <xsl:text>)()(</xsl:text> + <xsl:value-of select="refmeta/manvolnum"/> + <xsl:text>)(package)() </xsl:text> + + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="article"> + <xsl:text>article(</xsl:text> + <xsl:value-of select="title"/> + <xsl:text>)(</xsl:text> + <xsl:text>FIXME</xsl:text> + <xsl:text>)(</xsl:text> + <xsl:value-of select="articleinfo/pubdate"/> + <xsl:text>)</xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="report"> + <xsl:text>report(</xsl:text> + <xsl:value-of select="title"/> + <xsl:text>)(</xsl:text> + <xsl:text>FIXME</xsl:text> + <xsl:text>)(</xsl:text> + <xsl:value-of select="articleinfo/pubdate"/> + <xsl:text>)</xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="book"> + <xsl:text>book(</xsl:text> + <xsl:value-of select="title"/> + <xsl:text>)(</xsl:text> + <xsl:text>FIXME</xsl:text> + <xsl:text>)(</xsl:text> + <xsl:value-of select="articleinfo/pubdate"/> + <xsl:text>)</xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="chapter"> + <xsl:choose> + <xsl:when test="@id = ''"> + <xsl:text>chapter(</xsl:text> + <xsl:value-of select="title"/> + <xsl:text>) </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>lchapter(</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>)(</xsl:text> + <xsl:value-of select="title"/> + <xsl:text>) </xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="citerefentry"> + <xsl:value-of select="refentrytitle"/> + <xsl:text>(</xsl:text> + <xsl:value-of select="manvolnum"/> + <xsl:text>)</xsl:text> + </xsl:template> + + <xsl:template match="para"> + <xsl:apply-templates/> + <xsl:text> </xsl:text> + </xsl:template> + + <xsl:template match="formalpara"> + <xsl:text>paragraph(</xsl:text> + <xsl:value-of select="title"/> + <xsl:text>) </xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="part"> + <xsl:text>part(</xsl:text> + <xsl:value-of select="title"/> + <xsl:text>) </xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="preface"> + <xsl:text>nchapter(</xsl:text> + <xsl:value-of select="title"/> + <xsl:text>) </xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="quote"> + <xsl:text>"</xsl:text> + <xsl:apply-templates/> + <xsl:text>"</xsl:text> + </xsl:template> + + <xsl:template match="parameter|filename"> + <xsl:text>code(</xsl:text> + <xsl:apply-templates/> + <xsl:text>)</xsl:text> + </xsl:template> + + <xsl:template match="emphasis"> + <xsl:text>em(</xsl:text> + <xsl:apply-templates/> + <xsl:text>)</xsl:text> + </xsl:template> + + <xsl:template match="command"> + <xsl:text>bf(</xsl:text> + <xsl:apply-templates/> + <xsl:text>)</xsl:text> + </xsl:template> + + <xsl:template match="refnamediv"> + <xsl:text>manpagename(</xsl:text> + <xsl:value-of select="refname"/> + <xsl:text>)(</xsl:text> + <xsl:value-of select="refpurpose"/> + <xsl:text>) </xsl:text> + </xsl:template> + + <xsl:template match="refsynopsisdiv"> + <xsl:text>manpagesynopsis()</xsl:text> + </xsl:template> + + <xsl:template match="refsect1|refsect2"> + <xsl:choose> + <xsl:when test="title='DESCRIPTION'"> + <xsl:text> manpagedescription() </xsl:text> + </xsl:when> + <xsl:when test="title='OPTIONS'"> + <xsl:text> manpageoptions() </xsl:text> + </xsl:when> + <xsl:when test="title='FILES'"> + <xsl:text> manpagefiles() </xsl:text> + </xsl:when> + <xsl:when test="title='SEE ALSO'"> + <xsl:text> manpageseealso() </xsl:text> + </xsl:when> + <xsl:when test="title='DIAGNOSTICS'"> + <xsl:text> manpagediagnostics() </xsl:text> + </xsl:when> + <xsl:when test="title='BUGS'"> + <xsl:text> manpagebugs() </xsl:text> + </xsl:when> + <xsl:when test="title='AUTHOR'"> + <xsl:text> manpageauthor() </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text> manpagesection(</xsl:text> + <xsl:value-of select="title"/> + <xsl:text>) </xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="orderedlist"> + <xsl:text>startdit() </xsl:text> + <xsl:for-each select="listitem"> + <xsl:text>dit() </xsl:text> + <xsl:copy> + <xsl:apply-templates/> + </xsl:copy> + <xsl:text> </xsl:text> + </xsl:for-each> + <xsl:text>enddit() </xsl:text> + </xsl:template> + + <xsl:template match="itemizedlist"> + <xsl:text>startit() </xsl:text> + <xsl:for-each select="listitem"> + <xsl:text>it() </xsl:text> + <xsl:copy> + <xsl:apply-templates/> + </xsl:copy> + <xsl:text> </xsl:text> + </xsl:for-each> + <xsl:text>endit() </xsl:text> + </xsl:template> + + <xsl:template match="variablelist"> + <xsl:text>startdit() </xsl:text> + <xsl:for-each select="varlistentry"> + <xsl:text>dit(</xsl:text> + <xsl:copy-of select="term"> + <xsl:apply-templates/> + </xsl:copy-of> + <xsl:text>) </xsl:text> + <xsl:apply-templates select="listitem/para"/> + <xsl:text> </xsl:text> + </xsl:for-each> + <xsl:text>enddit() </xsl:text> + </xsl:template> + + <xsl:template match="anchor"> + <xsl:text>label(</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>) </xsl:text> + </xsl:template> + + <xsl:template match="footnote"> + <xsl:text>footnote(</xsl:text> + <xsl:apply-templates/> + <xsl:text>)</xsl:text> + </xsl:template> + + <xsl:template match="toc"> + <xsl:text>gettocstring() </xsl:text> + </xsl:template> + + <xsl:template match="ulink"> + <xsl:text> </xsl:text> + <xsl:text>url(</xsl:text> + <xsl:value-of select="url"/> + <xsl:text>)(</xsl:text> + <xsl:apply-templates/> + <xsl:text>)</xsl:text> + </xsl:template> + + <xsl:template match="link"> + <xsl:text>lref(</xsl:text> + <xsl:apply-templates/> + <xsl:text>)(</xsl:text> + <xsl:value-of select="@linkend"/> + <xsl:text>)</xsl:text> + </xsl:template> + + <xsl:template match="index"> + <xsl:text>printindex() </xsl:text> + </xsl:template> + + <xsl:template match="sect1"> + <xsl:choose> + <xsl:when test="@id = ''"> + <xsl:text>sect(</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>lsect(</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>)(</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="title"/> + <xsl:text>) </xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="sect2"> + <xsl:choose> + <xsl:when test="@id = ''"> + <xsl:text>subsect(</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>lsubsect(</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>)(</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="title"/> + <xsl:text>) </xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="sect3"> + <xsl:choose> + <xsl:when test="@id = ''"> + <xsl:text>subsubsect(</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>lsubsubsect(</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>)(</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="title"/> + <xsl:text>) </xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="sect4"> + <xsl:choose> + <xsl:when test="@id = ''"> + <xsl:text>subsubsubsect(</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>lsubsubsubsect(</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>)(</xsl:text> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="title"/> + <xsl:text>) </xsl:text> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="*"/> + +</xsl:stylesheet> |