DocBook Publishing - Output to HTML
I learned about DocBook last year and found it a great tool for technical documentation. It is a XML based semantic markup language. The DocBook is originally intended for computer hardware and software documentation but it is great for other documentation purposes.
I have been working on some documentation, new and converting existing from Lyx to DocBook. With DocBook, I am able to publish the contents easily to many formats, namely TEX, text, pdf or HTML. I had been trying to output some of my DocBook documentation to HTML.
This afternoon, I have finally succeeded to publish to HTML. I installed some DocBook packages on Ubuntu. Here are the packages you need to get DocBook going:
- docbook
- docbook-xsl
- docbook-xsl-doc
- docbook-xsl-doc-html
- docbook-xsl-doc-pdf
- docbook-xsl-doc-text
- xsltproc
- and optional xalan and fop
To output your DocBook document to HTML, simply this:
$ xsltproc --output paper.html \
/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl\
paper.xml
You can turn on chapter and section numbering by setting chapter.autolabel to 1 and section.autolabel to 1. To include the chapter number in every sections, set section.label.includes.component.label to 1.
$ xsltproc --output paper.html \
--stringparam section.autolabel 1 \
--stringparam section.label.includes.component.label 1 \
/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl \
paper.xml


Listen to my podcast