Haskell Documentation Tool
HTML Haskell CSS JavaScript TeX Makefile Shell
Latest commit 011c9e3 Jun 24, 2016 @Helkafen Helkafen committed on GitHub Merge pull request #537 from Helkafen/master
do not create empty src directory
Failed to load latest commit information.
doc Fix math typo and add link. Jun 9, 2016
driver-test The Haddock part for fully gcc-like response files Jan 1, 2016
driver The Haddock part for fully gcc-like response files Jan 2, 2016
haddock-api do not create empty src directory Jun 22, 2016
haddock-library Version bumps (2.17.3, 1.4.2) Jun 3, 2016
haddock-test publish haddock-test library Jun 6, 2016
hoogle-test testsuite: Rework handling of output sanitization Feb 8, 2016
html-test Copyright holders shown on several lines. Fix #279 Jun 16, 2016
hypsrc-test hypsrc-test: Accept test output Feb 8, 2016
latex-test testsuite: Rework handling of output sanitization Feb 8, 2016
.arcconfig Add an .arcconfig file. Dec 12, 2014
.arclint Add .arclint file. Dec 12, 2014
.ghci Move sources under haddock-api/src Aug 23, 2014
.gitignore Add appropriate .gitignore entry and configure Hoogle test suite. Aug 22, 2015
.travis.yml travis: Use Travis containers Dec 26, 2015
CHANGES Update CHANGES May 25, 2016
CONTRIBUTING CONTRIBUTING file for issues Sep 3, 2014
LICENSE Move Haddock API to a separate package Aug 22, 2014
Makefile Update Makefile for the new GHC build system Jul 5, 2009
README.md Fix Markdown formatting of README file. Aug 25, 2015
STYLE Add a pointer to the style guide Oct 17, 2010
Setup.lhs Fix Setup.lhs Oct 15, 2012
build-windows-dist.sh add build scripts Dec 20, 2007
ghc.mk ghc: Install files for needed --hyperlinked-source Apr 20, 2016
haddock.cabal publish haddock-test library Jun 6, 2016
haddock.wrapper GHC build system: Make *nix installation work in paths containing spaces Nov 5, 2009
make-sdist.sh Delete few unused/irrelevant/badly-place files. Aug 24, 2014

README.md

Haddock, a Haskell Documentation Tool

About haddock

This is Haddock, a tool for automatically generating documentation from annotated Haskell source code. It is primary intended for documenting library interfaces, but it should be useful for any kind of Haskell code.

Haddock lets you write documentation annotations next to the definitions of functions and types in the source code, in a syntax that is easy on the eye when writing the source code (no heavyweight mark-up). The documentation generated by Haddock is fully hyperlinked

  • click on a type name in a type signature to go straight to the definition, and documentation, for that type.

Haddock understands Haskell's module system, so you can structure your code however you like without worrying that internal structure will be exposed in the generated documentation. For example, it is common to implement a library in several modules, but define the external API by having a single module which re-exports parts of these implementation modules. Using Haddock, you can still write documentation annotations next to the actual definitions of the functions and types in the library, but the documentation annotations from the implementation will be propagated to the external API when the documentation is generated. Abstract types and classes are handled correctly. In fact, even without any documentation annotations, Haddock can generate useful documentation from your source code.

Documentation formats

Haddock can generate documentation in multiple formats; currently HTML is implemented, and there is partial support for generating LaTeX and Hoogle.

Source code documentation

Full documentation can be found in the doc/ subdirectory, in DocBook format.

Contributing

Please create issues when you have any problems and pull requests if you have some code.

Hacking

To get started you'll need a latest GHC release installed.

Clone the repository:

  git clone https://github.com/haskell/haddock.git
  cd haddock

and then proceed using your favourite build tool.

Using Cabal sandboxes
cabal sandbox init
cabal sandbox add-source haddock-library
cabal sandbox add-source haddock-api
cabal sandbox add-source haddock-test
# adjust -j to the number of cores you want to use
cabal install -j4 --dependencies-only --enable-tests
cabal configure --enable-tests
cabal build -j4
# run the test suite
export HADDOCK_PATH="dist/build/haddock/haddock"
cabal test
Using Stack
stack init
stack install
# run the test suite
export HADDOCK_PATH="$HOME/.local/bin/haddock"
stack test

If you're a GHC developer and want to update Haddock to work with your changes, you should be working on ghc-head branch instead of master. See instructions at https://ghc.haskell.org/trac/ghc/wiki/WorkingConventions/Git/Submodules for an example workflow.