diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-06-13 00:48:46 +0000 |
---|---|---|
committer | Gerald W. Carter <jerry@samba.org> | 2008-04-23 08:46:46 -0500 |
commit | 8a5498d3bfa78923cbb4e6c79e152431223a4f86 (patch) | |
tree | 6f14e0c9690c6b5363d70cf497b6f1639f8cecea /docs/xslt | |
parent | 5cec435fda2f812ef47185e331979e1072d62f43 (diff) | |
download | samba-8a5498d3bfa78923cbb4e6c79e152431223a4f86.tar.gz samba-8a5498d3bfa78923cbb4e6c79e152431223a4f86.tar.bz2 samba-8a5498d3bfa78923cbb4e6c79e152431223a4f86.zip |
Another set of updates; includes the new examples code and use of
10.5pt fonts. Still needs some polishing..
(This used to be commit eb11ea43f68f57d877dc80d4912396ad8e91a081)
Diffstat (limited to 'docs/xslt')
-rw-r--r-- | docs/xslt/expand-sambadoc.xsl | 65 | ||||
-rw-r--r-- | docs/xslt/latex.xsl | 62 | ||||
-rw-r--r-- | docs/xslt/latex/sambadoc.cls | 27 | ||||
-rw-r--r-- | docs/xslt/sambadoc2pearson.xsl | 24 |
4 files changed, 94 insertions, 84 deletions
diff --git a/docs/xslt/expand-sambadoc.xsl b/docs/xslt/expand-sambadoc.xsl index 5ded8c703b..37e70cca5a 100644 --- a/docs/xslt/expand-sambadoc.xsl +++ b/docs/xslt/expand-sambadoc.xsl @@ -22,7 +22,7 @@ </xsl:copy> </xsl:template> - <xsl:template match="smbconfexample/smbconfoption|smbconfblock/smbconfoption"> + <xsl:template match="smbconfblock/smbconfoption"> <xsl:element name="member"> <xsl:element name="indexterm"> @@ -31,9 +31,6 @@ </xsl:element> </xsl:element> <xsl:element name="parameter"> - <xsl:text disable-output-escaping="yes"> - <?latex \hspace{1cm} ?> - </xsl:text> <xsl:value-of select="@name"/> <xsl:choose> <xsl:when test="text() != ''"> @@ -45,17 +42,14 @@ </xsl:element> </xsl:template> - <xsl:template match="smbconfexample/smbconfcomment|smbconfblock/smbconfcomment"> - <xsl:text disable-output-escaping="yes"> - <?latex \hspace{1cm} ?> - </xsl:text> + <xsl:template match="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:template match="smbconfblock/smbconfsection"> <xsl:element name="member"> <xsl:text> </xsl:text> </xsl:element> @@ -105,35 +99,6 @@ </xsl:choose> </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/> @@ -146,33 +111,9 @@ </xsl:element> </xsl:template> - <xsl:template match="smbconfcomment"> - <xsl:text># </xsl:text> - <xsl:apply-templates/> - </xsl:template> - <xsl:template match="imagefile"> <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:value-of select="$latex.imagebasedir"/><xsl:text>images/</xsl:text><xsl:value-of select="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>html</xsl:text></xsl:attribute> <xsl:element name="imagedata"> <xsl:attribute name="fileref"> diff --git a/docs/xslt/latex.xsl b/docs/xslt/latex.xsl index ac9d2fe423..cc817427de 100644 --- a/docs/xslt/latex.xsl +++ b/docs/xslt/latex.xsl @@ -59,8 +59,66 @@ <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.documentclass">xslt/latex/sambadoc</xsl:param> -<xsl:param name="latex.documentclass.book"><xsl:value-of select="$fontsize"/>pt,openright,twoside</xsl:param> +<xsl:param name="latex.documentclass">sambadoc</xsl:param> +<xsl:param name="latex.documentclass.book">openright,twoside</xsl:param> <xsl:param name="latex.babel.language">english</xsl:param> +<xsl:template match="smbconfblock/smbconfoption"> + <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:value-of select="@name"/> + <xsl:text>}</xsl:text> + + <xsl:choose> + <xsl:when test="text() != ''"> + <xsl:text> = </xsl:text> + <xsl:value-of select="text()"/> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="smbconfblock"> + <xsl:text> \begin{lstlisting}[language=smbconf] </xsl:text> + <xsl:apply-templates/> + <xsl:text>\end{lstlisting} </xsl:text> +</xsl:template> + +<xsl:template match="smbconfsection"> + <xsl:text>\smbconfsection{</xsl:text> + <xsl:value-of select="translate(@name, '$','x')"/> + <xsl:text>}</xsl:text> +</xsl:template> + +<xsl:template match="imagefile"> + <xsl:text>\includegraphics[scale=.</xsl:text> + <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:text>]{</xsl:text> + <xsl:value-of select="$latex.imagebasedir"/><xsl:text>images/</xsl:text> + <xsl:value-of select="text()"/> + <xsl:text>} </xsl:text> +</xsl:template> + </xsl:stylesheet> diff --git a/docs/xslt/latex/sambadoc.cls b/docs/xslt/latex/sambadoc.cls index c80f143caf..fcd693e0ca 100644 --- a/docs/xslt/latex/sambadoc.cls +++ b/docs/xslt/latex/sambadoc.cls @@ -268,6 +268,19 @@ \plainfootrulewidth 0pt %---- no foot rule for chapter page \footrulewidth 0pt %---- no rule for foot + +%10.5pt fonts +\usepackage{type1cm} +\renewcommand\normalsize{% + \@setfontsize\normalsize{10.5pt}{12pt} + \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ + \belowdisplayskip \abovedisplayskip +\let\@listi\@listI} +\normalsize +% + %--- Redefine Headers \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} % @@ -476,7 +489,7 @@ page \thepage \space undefined}}% \renewcommand{\topfraction}{1.0} \renewcommand{\bottomfraction}{1.0} -\usepackage[twoside,dvips]{geometry} +\usepackage[twoside]{geometry} \geometry{% paperwidth=7in, @@ -493,3 +506,15 @@ headsep=.25in, footskip=.025in} \setlength{\headwidth}{\textwidth} + +% smb.conf syntax highlighting +\usepackage{listings} +\usepackage{xcolor} + +\lstdefinelanguage{smbconf}{ + morecomment=[l]{\#}, +} + +\lstset{backgroundcolor=\color{lightgray},frame=single,} +\newcommand{\smbconfsection}[1]{\emph{#1}} +\newcommand{\smbconfoption}[1]{\index{#1}\emph{#1}} diff --git a/docs/xslt/sambadoc2pearson.xsl b/docs/xslt/sambadoc2pearson.xsl index 5028d05064..d712419375 100644 --- a/docs/xslt/sambadoc2pearson.xsl +++ b/docs/xslt/sambadoc2pearson.xsl @@ -13,29 +13,15 @@ <xsl:strip-space elements="smbconfoption smbconfsection"/> - <xsl:template match="smbconfexample/smbconfsection|smbconfblock/smbconfsection"> + <xsl:template match="smbconfblock/smbconfsection"> <xsl:text> </xsl:text> <xsl:value-of select="."/><xsl:text> </xsl:text> </xsl:template> - <xsl:template match="smbconfexample/smbconfoption|smbconfblock/smbconfoption"> + <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="smbconfexample"> - <listing> - <xsl:call-template name="transform.id.attribute"/> - <xsl:if test="title != ''"> - <description><xsl:value-of select="title"/></description> - </xsl:if> - <listingcode> - <xsl:for-each select="smbconfoption|smbconfsection|smbconfcomment"> - <xsl:apply-templates select="."/> - </xsl:for-each> - </listingcode> - </listing> - </xsl:template> - <xsl:template match="smbconfblock"> <xsl:call-template name="transform.id.attribute"/> <listingcode> @@ -60,13 +46,13 @@ </figure> </xsl:template> - <xsl:template match="smbconfexample/smbconfcomment|smbconfblock/smbconfcomment"> + <xsl:template match="smbconfblock/smbconfcomment"> <xsl:text># </xsl:text><xsl:value-of select="text()"/><xsl:text> </xsl:text> </xsl:template> - <xsl:template match="smbconfexample/member|smbconfblock/member"> + <xsl:template match="smbconfblock/member"> <xsl:value-of select="text()"/><xsl:text> </xsl:text> - <xsl:message><xsl:text>Encountered <member> element inside of smbconfexample/smbconfblock!</xsl:text></xsl:message> + <xsl:message><xsl:text>Encountered <member> element inside of smbconfblock!</xsl:text></xsl:message> </xsl:template> <xsl:template match="filterline"> |