Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii" />
<title>docbook2X: Converting to man pages</title>
<link rel="stylesheet" href="docbook2X.css" type="text/css" />
<link rev="made" href="mailto:stevecheng@users.sourceforge.net" />
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1" />
<meta name="description" content=
"Details on man-page conversion" />
<link rel="start" href="docbook2X.html" title=
"docbook2X: Documentation Table of Contents" />
<link rel="up" href="docbook2X.html" title=
"docbook2X: Documentation Table of Contents" />
<link rel="prev" href="docbook2X.html" title=
"docbook2X: Documentation Table of Contents" />
<link rel="next" href="docbook2man.html" title=
"docbook2X: docbook2man" />
</head>
<body>
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">Converting to man pages</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href=
"docbook2X.html">&lt;&lt; Previous</a>&nbsp;</td>
<th width="60%" align="center">&nbsp;</th>
<td width="20%" align="right">&nbsp;<a accesskey="n" href=
"docbook2man.html">Next &gt;&gt;</a></td>
</tr>
</table>
<hr /></div>
<div class="sect1" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title"><a id="manpages" name="manpages"></a>Converting
to man pages</h2>
</div>
</div>
</div>
<a id="id2476295" class="indexterm" name="id2476295"></a><a id=
"id2476302" class="indexterm" name="id2476302"></a><a id=
"id2476309" class="indexterm" name="id2476309"></a><a id=
"id2476315" class="indexterm" name="id2476315"></a>
<p>DocBook documents are converted to man pages in two steps:</p>
<div class="orderedlist">
<ol type="1">
<li>
<p>The DocBook source is converted by a XSLT stylesheet into an
intermediate XML format, Man-XML.</p>
<p>Man-XML is simpler than DocBook and closer to the man page
format; it is intended to make the stylesheets&rsquo; job
easier.</p>
<p>The stylesheet for this purpose is in <code class=
"filename">xslt/man/docbook.xsl</code>. For portability, it should
always be referred to by the following URI:</p>
<pre class="synopsis">
http://docbook2x.sourceforge.net/latest/xslt/man/docbook.xsl
</pre>
<p>Run this stylesheet with <a href=
"db2x_xsltproc.html"><span><strong class=
"command">db2x_xsltproc</strong></span></a>.</p>
<a id="id2476395" class="indexterm" name="id2476395"></a>
<p><b>Customizing.&nbsp;</b> You can also customize the output by
creating your own XSLT stylesheet &mdash; changing parameters or
adding new templates &mdash; and importing <code class=
"filename">xslt/man/docbook.xsl</code>.</p>
</li>
<li>
<p>Man-XML is converted to the actual man pages by <a href=
"db2x_manxml.html"><span><strong class=
"command">db2x_manxml</strong></span></a>.</p>
</li>
</ol>
</div>
<p>The <a href="docbook2man.html" title=
"docbook2X: docbook2man"><span><strong class=
"command">docbook2man</strong></span></a> command does both steps
automatically, but if any problems occur, you can see the errors
more clearly if you do each step separately:</p>
<pre class="screen">
<code class="prompt">$ </code><strong class=
"userinput"><code>db2x_xsltproc -s man <em class=
"replaceable"><code>mydoc</code></em>.xml -o <em class=
"replaceable"><code>mydoc</code></em>.mxml</code></strong>
<code class="prompt">$ </code><strong class=
"userinput"><code>db2x_manxml <em class=
"replaceable"><code>mydoc</code></em>.mxml</code></strong>
</pre>
<p>Options to the conversion stylesheet are described in <a href=
"../xslt/documentation/docbook2man-xslt.html/docbook2man-xslt.html">
the man-pages stylesheets reference</a>.</p>
<a id="id2523989" class="indexterm" name="id2523989"></a>
<p><b>Pure XSLT conversion.&nbsp;</b> An alternative to the
<span><strong class="command">db2x_manxml</strong></span> Perl
script is the XSLT stylesheet in <code class=
"filename">xslt/backend/db2x_manxml.xsl</code>. This stylesheet
performs a similar function of converting Man-XML to actual man
pages. It is useful if you desire a pure XSLT solution to man-page
conversion. Of course, the quality of the conversion using this
stylesheet will never be as good as the Perl <span><strong class=
"command">db2x_manxml</strong></span>, and it runs slower. In
particular, the pure XSLT version currently does not support tables
in man pages, but its Perl counterpart does. <span class="html">For
instructions on how to use the stylesheet, see <a href=
"xsltproc.html#xsltproc.db2x_manxml" title=
"Example&nbsp;1.&nbsp;Convert to man pages using pure-XSLT db2x_manxml">
Example&nbsp;1, &ldquo;Convert to man pages using pure-XSLT
<span>db2x_manxml</span>&rdquo;</a>.</span></p>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href=
"docbook2X.html">&lt;&lt; Previous</a>&nbsp;</td>
<td width="20%" align="center">&nbsp;</td>
<td width="40%" align="right">&nbsp;<a accesskey="n" href=
"docbook2man.html">Next &gt;&gt;</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">docbook2X&nbsp;</td>
<td width="20%" align="center"><a accesskey="h" href=
"docbook2X.html">Table of Contents</a></td>
<td width="40%" align="right" valign="top">&nbsp;docbook2man</td>
</tr>
</table>
</div>
<p class="footer-homepage"><a href=
"http://docbook2x.sourceforge.net/" title=
"docbook2X: Home page">docbook2X home page</a></p>
</body>
</html>