summaryrefslogtreecommitdiff
path: root/docs/docbook/xslt
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-09-09 02:58:53 +0000
committerGerald Carter <jerry@samba.org>2003-09-09 02:58:53 +0000
commit99bde6889d3d8b7a9e950c86c30e82662e1dacdd (patch)
treebb7d34722e3b2b98ae7e36c11f4e7e4d4538b6fb /docs/docbook/xslt
parenta50367ee119d0acf1bcaaf93f8c6fcc8fa68c999 (diff)
downloadsamba-99bde6889d3d8b7a9e950c86c30e82662e1dacdd.tar.gz
samba-99bde6889d3d8b7a9e950c86c30e82662e1dacdd.tar.bz2
samba-99bde6889d3d8b7a9e950c86c30e82662e1dacdd.zip
syncing files from 3.0 into HEAD again
(This used to be commit bca0bba209255d0effbae6a3d3b6d298f0952c3a)
Diffstat (limited to 'docs/docbook/xslt')
-rw-r--r--docs/docbook/xslt/expand-sambadoc.xsl304
-rw-r--r--docs/docbook/xslt/generate-attributions.xsl39
-rw-r--r--docs/docbook/xslt/html-common.xsl3
-rw-r--r--docs/docbook/xslt/latex.xsl17
-rw-r--r--docs/docbook/xslt/latex/sambadoc.cls2
5 files changed, 341 insertions, 24 deletions
diff --git a/docs/docbook/xslt/expand-sambadoc.xsl b/docs/docbook/xslt/expand-sambadoc.xsl
new file mode 100644
index 0000000000..2749fdf3e9
--- /dev/null
+++ b/docs/docbook/xslt/expand-sambadoc.xsl
@@ -0,0 +1,304 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:exsl="http://exslt.org/common"
+ xmlns:samba="http://samba.org/common"
+ version="1.1"
+ extension-element-prefixes="exsl">
+
+<xsl:output method="xml"/>
+
+<xsl:param name="xmlSambaNsUri" select="'http://samba.org/common'"/>
+
+<xsl:template match="reference/refentry/refsect1">
+ <xsl:if test="title!='VERSION' and title!='AUTHOR'">
+ <xsl:element name="refsect1">
+ <xsl:if test="@id!=''">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="reference/refentry">
+ <xsl:element name="section">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ <xsl:element name="title">
+ <xsl:value-of select="refmeta/refentrytitle"/>
+<!-- <xsl:text> (</xsl:text>
+ <xsl:value-of select="refnamediv/refpurpose"/>
+ <xsl:text>)</xsl:text>-->
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="reference/refentry/refmeta"/>
+
+<xsl:template match="reference/refentry/refnamediv"/>
+
+<xsl:template match="reference">
+ <xsl:element name="appendix">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="/node()">
+ <xsl:text disable-output-escaping="yes">
+&lt;!DOCTYPE </xsl:text><xsl:value-of select="name(.)"/><xsl:text disable-output-escaping="yes"> PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+
+ &lt;!ENTITY % globalentities SYSTEM 'global.ent'> %globalentities;
+ ]>
+</xsl:text>
+<xsl:copy>
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
+ <xsl:apply-templates/>
+</xsl:copy>
+</xsl:template>
+
+
+<!-- This is needed to copy content unchanged -->
+<xsl:template match="@*|node()">
+
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="smbconfexample/smbconfoption|smbconfblock/smbconfoption">
+ <xsl:element name="member">
+ <xsl:element name="parameter">
+ <xsl:value-of select="name"/>
+ <xsl:choose>
+ <xsl:when test="value != ''">
+ <xsl:text> = </xsl:text>
+ <xsl:value-of select="value"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="smbconfexample/smbconfcomment|smbconfblock/smbconfcomment">
+ <xsl:element name="member">
+ <xsl:text># </xsl:text>
+ <xsl:apply-templates/>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="smbconfexample/smbconfsection|smbconfblock/smbconfsection">
+ <xsl:element name="member">
+ <xsl:text> </xsl:text>
+ </xsl:element>
+ <xsl:element name="member">
+ <xsl:element name="parameter">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="smbconfoption">
+ <!-- Include an index term -->
+ <xsl:element name="indexterm">
+ <xsl:element name="primary">
+ <xsl:value-of select="name"/>
+ </xsl:element>
+ </xsl:element>
+
+<!-- FIXME: Do this only when smb.conf is included
+ <xsl:element name="link">
+ <xsl:attribute name="linkend">
+ <xsl:value-of select="translate(translate(string(name),' ',''),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+ </xsl:attribute>-->
+
+ <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="value != ''">
+ <xsl:text> = </xsl:text>
+ <xsl:value-of select="value"/>
+ </xsl:when>
+ </xsl:choose>
+ <!--
+ </xsl:element>-->
+</xsl:template>
+
+<!-- FIXME: Needs extension sometime -->
+<xsl:template match="ntgroup|ntuser">
+ <xsl:element name="emphasis">
+ <xsl:apply-templates/>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="smbconfexample">
+ <xsl:choose>
+ <xsl:when test="title = ''">
+ <xsl:message>
+ <xsl:text>Warning: smbconfexample does not have title!</xsl:text>
+ </xsl:message>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:element name="example">
+ <xsl:choose>
+ <xsl:when test="@id != ''">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:element name="title">
+ <xsl:value-of select="title"/>
+ </xsl:element>
+ <xsl:element name="simplelist">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="smbconfexample/title">
+</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:apply-templates/>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="smbconfcomment">
+ <xsl:text># </xsl:text>
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="image">
+ <xsl:element name="figure">
+ <xsl:attribute name="id">
+ <xsl:choose>
+ <xsl:when test="@id != ''">
+ <xsl:value-of select="@id"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="imagefile"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+
+ <xsl:element name="title">
+ <xsl:value-of select="imagedescription"/>
+ </xsl:element>
+ <xsl:element name="mediaobject">
+ <xsl:element name="imageobject">
+ <xsl:attribute name="role"><xsl:text>latex</xsl:text></xsl:attribute>
+ <xsl:element name="imagedata">
+ <xsl:attribute name="fileref">
+ <xsl:text>projdoc/imagefiles/</xsl:text><xsl:value-of select="imagefile"/></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:element name="imagedata">
+ <xsl:attribute name="fileref">
+ <xsl:text>projdoc/imagefiles/</xsl:text><xsl:value-of select="imagefile"/><xsl:text>.png</xsl:text></xsl:attribute>
+ <xsl:attribute name="scale"><xsl:text>50</xsl:text></xsl:attribute>
+ <xsl:attribute name="scalefit"><xsl:text>1</xsl:text></xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="//samba:parameter">
+ <!-- reconstruct varlistentry - not all of them will go into separate files
+ and also we must repair the main varlistentry itself.
+ -->
+ <xsl:variable name="name"><xsl:value-of select="translate(translate(string(@name),' ',''),
+ 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+ </xsl:variable>
+
+ <xsl:variable name="anchor">
+ <xsl:element name="anchor">
+ <xsl:attribute name="id">
+ <xsl:value-of select="$name"/>
+ </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:element name="term">
+ <xsl:copy-of select="$anchor"/>
+ <xsl:value-of select="@name"/>
+ <xsl:value-of select="$context"/>
+ </xsl:element>
+ </xsl:variable>
+
+ <xsl:variable name="content">
+ <xsl:apply-templates/>
+ </xsl:variable>
+
+ <xsl:element name="varlistentry">
+ <xsl:text>&#10;</xsl:text>
+ <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:copy-of select="$content"/>
+ <xsl:text>
+</xsl:text>
+ </xsl:element>
+
+</xsl:template>
+
+<xsl:template match="ulink">
+ <xsl:element name="ulink">
+ <xsl:attribute name="url">
+ <xsl:value-of select="@url"/>
+ </xsl:attribute>
+
+ <xsl:apply-templates/>
+
+ </xsl:element>
+</xsl:template>
+
+
+</xsl:stylesheet>
diff --git a/docs/docbook/xslt/generate-attributions.xsl b/docs/docbook/xslt/generate-attributions.xsl
index c781a77cc4..29683b1921 100644
--- a/docs/docbook/xslt/generate-attributions.xsl
+++ b/docs/docbook/xslt/generate-attributions.xsl
@@ -12,38 +12,39 @@
<xsl:apply-templates select="@*|node()"/>
</xsl:template>
-<xsl:template match="book">
- <xsl:element name="variablelist">
- <xsl:apply-templates/>
- </xsl:element>
-</xsl:template>
-
<xsl:template match="chapter">
- <xsl:element name="varlistentry">
- <xsl:element name="term">
- <xsl:element name="link">
- <xsl:attribute name="linkend"><xsl:value-of select="@id"/></xsl:attribute>
- <xsl:value-of select="title"/>
- </xsl:element>
- </xsl:element>
- <xsl:element name="listitem">
+ <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:element name="itemizedlist">
- <xsl:apply-templates/>
+ <xsl:apply-templates/>
</xsl:element>
</xsl:element>
- </xsl:element>
- </xsl:element>
+ </xsl:when>
+ </xsl:choose>
</xsl:template>
<xsl:template match="author">
<xsl:element name="listitem">
<xsl:element name="para">
- <xsl:value-of select="firstname"/><xsl:text> </xsl:text><xsl:value-of select="surname"/>
+ <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:text> &lt;</xsl:text>
<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"/>
@@ -62,6 +63,8 @@
</xsl:choose>
</xsl:element>
</xsl:element>
+ <xsl:text>
+ </xsl:text>
</xsl:template>
</xsl:stylesheet>
diff --git a/docs/docbook/xslt/html-common.xsl b/docs/docbook/xslt/html-common.xsl
index ecb8a08662..dce900ef67 100644
--- a/docs/docbook/xslt/html-common.xsl
+++ b/docs/docbook/xslt/html-common.xsl
@@ -19,4 +19,7 @@
<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:stylesheet>
diff --git a/docs/docbook/xslt/latex.xsl b/docs/docbook/xslt/latex.xsl
index 8fafd5d140..406a64b646 100644
--- a/docs/docbook/xslt/latex.xsl
+++ b/docs/docbook/xslt/latex.xsl
@@ -1,18 +1,21 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
-<xsl:import href="db2latex/docbook.xsl"/>
-<xsl:import href="table.mod.xsl"/>
-<xsl:import href="lists.mod.xsl"/>
+<xsl:import href="http://db2latex.sourceforge.net/xsl/docbook.xsl"/>
<xsl:output method="text" encoding="ISO-8859-1" indent="yes"/>
-<xsl:variable name="latex.documentclass">xslt/latex/sambadoc</xsl:variable>
-<xsl:variable name="latex.documentclass.common">english,final,titlepage,parskip</xsl:variable>
+<xsl:param name="l10n.gentext.default.language">en</xsl:param>
+<xsl:variable name="latex.documentclass">sambadoc</xsl:variable>
+<xsl:variable name="latex.documentclass.common">english,final,titlepage,parskip,<xsl:value-of select="$papersize"/>,<xsl:value-of select="$fontsize"/>pt</xsl:variable>
<xsl:variable name="latex.documentclass.book"></xsl:variable>
+<xsl:variable name="latex.generate.indexterm">1</xsl:variable>
<xsl:variable name="latex.hyperref.param.pdftex">hyperfigures,hyperindex,citecolor=blue,urlcolor=blue</xsl:variable>
<xsl:variable name="latex.document.font">default</xsl:variable>
<xsl:variable name="latex.admonition.path">xslt/figures</xsl:variable>
<xsl:variable name="latex.hyphenation.tttricks">1</xsl:variable>
<xsl:variable name="latex.use.tabularx">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:param name="latex.babel.language">english</xsl:param>
<xsl:param name="ulink.url">1</xsl:param>
@@ -31,5 +34,9 @@
</xsl:if>
</xsl:template>
+<xsl:template name="latex.thead.row.entry">
+<xsl:text>{\bfseries </xsl:text><xsl:apply-templates/><xsl:text>}</xsl:text>
+</xsl:template>
+
</xsl:stylesheet>
diff --git a/docs/docbook/xslt/latex/sambadoc.cls b/docs/docbook/xslt/latex/sambadoc.cls
index 9f3caa5482..fcea11992f 100644
--- a/docs/docbook/xslt/latex/sambadoc.cls
+++ b/docs/docbook/xslt/latex/sambadoc.cls
@@ -2,7 +2,7 @@
%%-- RC Thesis
%%---------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{xslt/latex/sambadoc}
+\ProvidesClass{sambadoc}
%%---------------------------------------------------
%%-- Load the base class and modify current macros.