[Haskell-cafe] haddock as a markdown preprocessor

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Fri Feb 22 20:28:33 EST 2008

On Fri, 2008-02-22 at 07:21 -0800, Keith Fahlgren wrote:
> On 2/21/08 3:57 PM, Duncan Coutts wrote:
> > Consequently there is no support in
> > Cabal etc for those kinds of documentation. GHC, Cabal and c2hs amongst
> > others use docbook but it's a horrible format to write and the tools to
> > process it are very finicky (we apparently have to hard code paths to
> > specific versions of xslt stylesheets).
> Hi,
> DocBook authoring tools have progressed tremendously in the past few years, and
> I disagree that the "tools to process it are very finicky". If there are
> specific questions about making DocBook more palatable for GHC, Cabal, c2hs,
> others, please send them to me directly or the docbook-apps list:
> http://www.docbook.org/help

I admit to knowing rather little about it but I've noticed that these
three projects are using xsltproc directly as their docbook processor
(the other two just copied GHC). Because xsltproc is a general purpose
tool they have to supply a large number of parameters including a hard
coded location of an xslt script (and xsltproc seems to always want to
go to the network to download a dtd when it already has a version it can
use offline).

Currently Cabal uses:
        xsltproc --param use.id.as.filename 1 --param toc.section.depth 3
         --stringparam base.dir dist/doc/users-guide/
         --stringparam html.stylesheet doc/fptools.css

Yes, that's a hard coded path to the style sheet. GHC does it slightly
more cleverly by using a configure.ac test to look through a very large
number of hard coded paths to try and find the above style sheet.
c2hs used to use docbook2html which was easier to use in terms of
specifying command lines but produced worse output and didn't seem to
work on more recent distros so c2hs switched to xml docbook format
rather than the previous sgml format.

Basically I'd like to know what tool (that is packaged on every linux
distro) do I use to convert a docbook .xml file to xhtml. I took a quick
look on the FAQ linked from docbook.org/help and could not immediately
find what standard tools and commands I'm supposed to use.


More information about the Haskell-Cafe mailing list