mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
XSL script for converting DocBook XML to Yodl, almost done :-)
(This used to be commit b9404cd05db77efbb81fc59925aaff59d45416fa)
This commit is contained in:
parent
83a17815a7
commit
fc5ad178db
108
docs/xslt/yodl.xsl
Normal file
108
docs/xslt/yodl.xsl
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--
|
||||
DocBook to yodl converter
|
||||
Currently only for manpages
|
||||
|
||||
(C) Jelmer Vernooij 2004
|
||||
-->
|
||||
<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"/>
|
||||
<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="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">
|
||||
manpagesynopsis()
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="refsect1">
|
||||
<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:for-each select="para">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="itemizedlist|orderedlist">
|
||||
<xsl:text>startdit() </xsl:text>
|
||||
<xsl:for-each select="listitem">
|
||||
<xsl:text>dit() </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text>enddit() </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="variablelist">
|
||||
<xsl:text>startdit() </xsl:text>
|
||||
<xsl:for-each select="varlistentry">
|
||||
<xsl:text>dit(</xsl:text>
|
||||
<xsl:value-of select="term"/>
|
||||
<xsl:text>) </xsl:text>
|
||||
<xsl:apply-templates select="listitem"/>
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text>enddit() </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="*"/>
|
||||
|
||||
</xsl:stylesheet>
|
Loading…
x
Reference in New Issue
Block a user