edeca.net logo
  • rss
  • Home
  • Graphics
  • Electronics
  • Computing
    • ROT Util
    • MOTD maker
    • GNU screen config
    • VB6 reverse DNS
    • VB6 RichTextBox control
  • About

Docbook XML made easy

David | November 16, 2009

In a slightly crazed moment today I decided to write some documentation. Having used Docbook before for my UML Bridging Tutorial, I thought I’d pay it another visit.


As I was lazy and wanted a quick GUI way to do markup, I found an XML editor from XMLmind. It is written in Java so should run in most places and, except a few quirks, seems really good. An hour later I had a few chapters written in Docbook markup ready to be published.

However, I couldn’t find many sites that gave a quick and easy example of how to convert from XML to PDF or HTML. It seems that for Docbook XML you need a toolchain, which means understanding in a lot of detail what each stage does. With Docbook SGML there were a number of nifty docbook2x programs which did the work and gave HTML, PDF or text output (amongst others).

To duplicate this quickly and easily with Docbook XML, I found that xmlto and dblatex were the solution. To create an HTML document, it couldn’t be easier than:

# Make a one page per chapter HTML book
$ xmlto xhtml MyDocument.xml
# Make a one page HTML document
$ xmlto html-nochunks MyDocument.xml

For PDF, it is as simple as:

# dblatex defaults to PDF
$ dblatex MyDocument.xml

Both of these packages (as well as the Docbook stylesheets) have been available in Ubuntu since 8.04. In order to make (X)HTML output prettier, you might like to look at this page which gives a great tutorial.

Categories
Computing
Tags
convert, docbook, html, pdf, xml
Comments rss
Comments rss
Trackback
Trackback

« Printing in Windows 7 Blocking SSH brute forcing using denyhosts »

Leave a Reply

Click here to cancel reply.

Categories

  • Computing
  • Electronics
  • General
  • Perl
  • Photography

Archives

  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • November 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009

Links

  • My photo gallery
  • Pookey's site

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox