summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-06-21 20:26:59 +0000
committerGerald W. Carter <jerry@samba.org>2008-04-23 08:45:56 -0500
commit6d19d019e4adb751feb727a1aee91ca61de07e6d (patch)
tree0f591220278ccea779d910cb59e17e38dc74843a
parentfc5ad178dbe7ab92e2fed298f74804d4fe9c8073 (diff)
downloadsamba-6d19d019e4adb751feb727a1aee91ca61de07e6d.tar.gz
samba-6d19d019e4adb751feb727a1aee91ca61de07e6d.tar.bz2
samba-6d19d019e4adb751feb727a1aee91ca61de07e6d.zip
All yodl macros are used now :-) Not all
docbook tags are supported at the moment (tables, author information, verbatim stuff, bibliographies..) but that will follow later. It took me under 45 minutes to write all this; XSL is neat! :-) (This used to be commit cf5843dd160cca5c61c43580c62111beb3ab7545)
-rw-r--r--docs/xslt/yodl.xsl216
1 files changed, 211 insertions, 5 deletions
diff --git a/docs/xslt/yodl.xsl b/docs/xslt/yodl.xsl
index 96fd718454..9752858bce 100644
--- a/docs/xslt/yodl.xsl
+++ b/docs/xslt/yodl.xsl
@@ -1,7 +1,9 @@
<?xml version='1.0'?>
<!--
DocBook to yodl converter
- Currently only for manpages
+
+ Lacks support for a few docbook tags, but pretty much all
+ yodl macros are used
(C) Jelmer Vernooij 2004
-->
@@ -22,6 +24,100 @@
<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>)&#10;</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>)&#10;</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>&#10;&#10;</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="formalpara">
+ <xsl:text>paragraph(</xsl:text>
+ <xsl:value-of select="title"/>
+ <xsl:text>)&#10;</xsl:text>
+ <xsl:for-each select="para">
+ <xsl:copy>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template match="part">
+ <xsl:text>part(</xsl:text>
+ <xsl:value-of select="title"/>
+ <xsl:text>)&#10;</xsl:text>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="preface">
+ <xsl:text>nchapter(</xsl:text>
+ <xsl:value-of select="title"/>
+ <xsl:text>)&#10;</xsl:text>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="parameter">
+ <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/>
@@ -76,21 +172,36 @@
</xsl:otherwise>
</xsl:choose>
<xsl:for-each select="para">
- <xsl:text>&#10;&#10;</xsl:text>
- <xsl:apply-templates/>
+ <xsl:copy>
+ <xsl:apply-templates/>
+ </xsl:copy>
</xsl:for-each>
</xsl:template>
- <xsl:template match="itemizedlist|orderedlist">
+ <xsl:template match="orderedlist">
<xsl:text>startdit()&#10;</xsl:text>
<xsl:for-each select="listitem">
<xsl:text>dit() </xsl:text>
- <xsl:apply-templates/>
+ <xsl:copy>
+ <xsl:apply-templates/>
+ </xsl:copy>
<xsl:text>&#10;</xsl:text>
</xsl:for-each>
<xsl:text>enddit()&#10;</xsl:text>
</xsl:template>
+ <xsl:template match="itemizedlist">
+ <xsl:text>startit()&#10;</xsl:text>
+ <xsl:for-each select="listitem">
+ <xsl:text>it() </xsl:text>
+ <xsl:copy>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:for-each>
+ <xsl:text>endit()&#10;</xsl:text>
+ </xsl:template>
+
<xsl:template match="variablelist">
<xsl:text>startdit()&#10;</xsl:text>
<xsl:for-each select="varlistentry">
@@ -103,6 +214,101 @@
<xsl:text>enddit()&#10;</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()&#10;</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="ulink">
+ <xsl:text>&#10;</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()&#10;</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>)&#10;</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>)&#10;</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>)&#10;</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>)&#10;</xsl:text>
+ <xsl:apply-templates/>
+ </xsl:template>
+
<xsl:template match="*"/>
</xsl:stylesheet>