| 1 |
GENERATING THE DOCUMENTATION |
| 2 |
|
| 3 |
The documentation source is a DocBook refentry. Texinfo would have |
| 4 |
made more sense, but at the time it was a nice excuse to have a look |
| 5 |
at DocBook, xml and xslt. |
| 6 |
|
| 7 |
The manpage and pdf were generated separately, not as part of the |
| 8 |
TeX Live build process. |
| 9 |
|
| 10 |
The required tools, dblatex and xmlto, are available as Ubuntu- and |
| 11 |
Debian packages. |
| 12 |
|
| 13 |
The pdf is generated with dblatex, with a command-line |
| 14 |
|
| 15 |
dblatex -P latex.hyperparam=bookmarks=false,colorlinks \ |
| 16 |
-s ./mystyle.sty \ |
| 17 |
-p ./dbl.xsl \ |
| 18 |
afm2pl.xml |
| 19 |
|
| 20 |
This is the contents of mystyle.sty: |
| 21 |
|
| 22 |
\NeedsTeXFormat{LaTeX2e} |
| 23 |
\ProvidesPackage{mystyle} |
| 24 |
\RequirePackageWithOptions{db2latex} |
| 25 |
\AtBeginDocument{\setcounter{secnumdepth}{-1}} |
| 26 |
|
| 27 |
This is the contents of dbl.xsl: |
| 28 |
|
| 29 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 30 |
version='1.0'> |
| 31 |
|
| 32 |
<xsl:variable name="arg.choice.opt.open.str"><xsl:text> [</xsl:text></xsl:variable> |
| 33 |
<xsl:variable name="arg.choice.opt.close.str"><xsl:text>] </xsl:text></xsl:variable> |
| 34 |
<xsl:variable name="arg.choice.req.open.str"><xsl:text> {</xsl:text></xsl:variable> |
| 35 |
<xsl:variable name="arg.choice.req.close.str"><xsl:text>} </xsl:text></xsl:variable> |
| 36 |
<xsl:variable name="arg.choice.def.open.str"><xsl:text> [</xsl:text></xsl:variable> |
| 37 |
<xsl:variable name="arg.choice.def.close.str"><xsl:text>] </xsl:text></xsl:variable> |
| 38 |
|
| 39 |
<xsl:template match="cmdsynopsis"> |
| 40 |
<xsl:text>{\raggedright\parindent0pt\parskip7pt </xsl:text> |
| 41 |
<xsl:call-template name="label.id"/> |
| 42 |
<xsl:apply-templates/> |
| 43 |
<xsl:text> \par}</xsl:text> |
| 44 |
</xsl:template> |
| 45 |
|
| 46 |
<xsl:param name="monoseq.hyphenation">0</xsl:param> |
| 47 |
<xsl:template match="synopsis"> |
| 48 |
<xsl:call-template name="label.id"/> |
| 49 |
<xsl:call-template name="output.verbatim"/> |
| 50 |
</xsl:template> |
| 51 |
<xsl:template match="option"> |
| 52 |
<xsl:call-template name="inline.monoseq"/><xsl:text> </xsl:text> |
| 53 |
</xsl:template> |
| 54 |
</xsl:stylesheet> |
| 55 |
|
| 56 |
The manpage is generated with xmlto, which uses xsltproc and docbook |
| 57 |
xsl transformations. The command-line is: |
| 58 |
|
| 59 |
xmlto -m xml2.xsl man afm2pl.xml |
| 60 |
|
| 61 |
This is the contents of xml2.xsl: |
| 62 |
|
| 63 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> |
| 64 |
<xsl:variable name="arg.choice.req.open.str"></xsl:variable> |
| 65 |
<xsl:variable name="arg.choice.req.close.str"></xsl:variable> |
| 66 |
<xsl:template name="make.toc"></xsl:template> |
| 67 |
</xsl:stylesheet> |
| 68 |
|
| 69 |
An html version can be generated with |
| 70 |
|
| 71 |
xmlto -m xml2.xsl html-nochunks afm2pl.xml |
| 72 |
|
| 73 |
June 21 2009 |
| 74 |
|
| 75 |
Siep Kroonenberg |
| 76 |
[email protected] |
| 77 |
http://tex.aanhet.net/afm2pl/ |