aboutsummaryrefslogtreecommitdiffstats
path: root/doc/user-guide/docbook.xsl
blob: 21d6b08ed03718e6327f0491e731a9f8350e436b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #
<?xml version='1.0'?>
<!--
	Convert BitlBee XML documentation to DocBook
	(C) 2004 Jelmer Vernooij
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:exsl="http://exslt.org/common"
	version="1.1"
	extension-element-prefixes="exsl">

	<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:strip-space elements="*"/>

	<xsl:template match="ircline">
		<xsl:element name="prompt"><xsl:text>&lt; </xsl:text><xsl:value-of select="@nick"/><xsl:text>&gt; </xsl:text></xsl:element>
		<xsl:element name="userinput"><xsl:value-of select="normalize-space(.)"/></xsl:element><xsl:text>&#10;</xsl:text>
	</xsl:template>

	<xsl:template match="ircaction">
		<xsl:text> * </xsl:text><xsl:value-of select="@nick"/><xsl:text> </xsl:text><xsl:value-of select="normalize-space(.)"/><xsl:text>&#10;</xsl:text>
	</xsl:template>

	<xsl:template match="ircexample">
		<xsl:element name="screen">
			<xsl:for-each select="ircline|ircaction">
				<xsl:apply-templates select="."/>
			</xsl:for-each>
		</xsl:element>
	</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 name="subcmd-list">
		<xsl:if test="bitlbee-command != ''">
			<xsl:element name="variablelist">
				<xsl:for-each select="bitlbee-command">
					<xsl:element name="varlistentry">
						<xsl:element name="term">
							<xsl:value-of select="@name"/>
						</xsl:element>
						<xsl:element name="listitem">
							<xsl:element name="para">
								<xsl:value-of select="short-description"/>
							</xsl:element>
						</xsl:element>
					</xsl:element>
				</xsl:for-each>
			</xsl:element>
		</xsl:if>
	</xsl:template>

	<xsl:template match="command-list">
		<xsl:call-template name="subcmd-list"/>
	</xsl:template>

	<xsl:template match="bitlbee-setting">
		<xsl:element name="sect1">
			<xsl:attribute name="id">
				<xsl:text>set_</xsl:text>
				<xsl:value-of select="@name"/>
			</xsl:attribute>
			<xsl:element name="title"><xsl:value-of select="@name"/></xsl:element>

			<xsl:element name="simplelist">
				<xsl:element name="member">
					<xsl:text>Type: </xsl:text><xsl:value-of select="@type"/>
				</xsl:element>
			</xsl:element>

			<xsl:for-each select="description/para">
				<xsl:apply-templates select="."/>
			</xsl:for-each>

		</xsl:element>
	</xsl:template>

	<xsl:template name="cmd">
		<xsl:param name="prefix"/>
		<xsl:variable name="thiscmd"><xsl:value-of select="$prefix"/><xsl:value-of select="@name"/></xsl:variable>
		<xsl:attribute name="id">
			<xsl:text>cmd_</xsl:text>
			<xsl:value-of select="translate($thiscmd,' ','_')"/>
		</xsl:attribute>
		<xsl:element name="title"><xsl:value-of select="$thiscmd"/>
			<xsl:if test="short-description">
				<xsl:text> - </xsl:text>
				<xsl:value-of select="short-description"/>
			</xsl:if>
		</xsl:element>

		<xsl:element name="formalpara">
			<xsl:element name="title"><xsl:text>Syntax:</xsl:text></xsl:element>
			<xsl:element name="para">
				<xsl:element name="programlisting">
					<xsl:for-each select="syntax">
						<xsl:value-of select="normalize-space(.)"/><xsl:text>&#10;</xsl:text>
					</xsl:for-each>
				</xsl:element>
			</xsl:element>
		</xsl:element>

		<xsl:for-each select="description/para">
			<xsl:apply-templates select="."/>
		</xsl:for-each>

		<xsl:for-each select="ircexample">
			<xsl:apply-templates select="."/>
		</xsl:for-each>

		<!--<xsl:call-template name="subcmd-list"/>-->

		<xsl:for-each select="bitlbee-command">
			<xsl:element name="sect2">
				<xsl:call-template name="cmd">
					<xsl:with-param name="prefix"><xsl:value-of select="$thiscmd"/><xsl:text> </xsl:text>
					</xsl:with-param>
				</xsl:call-template>
			</xsl:element>
		</xsl:for-each>
	</xsl:template>

	<xsl:template match="bitlbee-command">
		<xsl:element name="sect1">
			<xsl:call-template name="cmd">
				<xsl:with-param name="prefix" select="''"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>

	</xsl:stylesheet>