HADDOCK(1)

πŸ’– HADDOCK(1) πŸ’–

okay bestie, gather round, because we're about to talk about haddock β€” the documentation tool for annotated Haskell source code, and yes, it lives in manual section 1, and yes, it's iconic. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

haddock [options] file...

🌸 DESCRIPTION 🌸

so this manual page is just the lil brief rundown of the haddock command, fr fr. the extensive documentation lives in a bunch of other formats β€” DVI, PostScript, HTML, the whole wardrobe β€” and you can peep the pointers down in SEE ALSO.

file is a filename that holds a Haskell source module. every module you hand over on the command line gets processed together, like one big group project 🫢. and the cute part? when one module refers to an entity that's in another module you're also processing, the docs will link straight to that entity. hyperlink slay.

now, entities that can't be found β€” say, because they're chillin' in a module that's not part of the current batch β€” simply will not get hyperlinked in the generated documentation. no drama, they're just unlinked. but haddock will emit warnings listing every single identifier it couldn't resolve, so you'll know exactly who ghosted you. πŸ’€

⚠️ and this is the important one: the modules should not be mutually recursive. haddock does not like swimming in circles. periodt.

✨ OPTIONS ✨

these programs follow the usual GNU command line syntax, with long options starting with two dashes (`--'). here's the summary, bestie. for the complete description, go read the other documentation. πŸ’…

  • -o DIR, --odir=DIR β€” the directory where the output files go πŸŽ€
  • -i FILE, --read-interface=FILE β€” read an interface from FILE.
  • -D FILE, --dump-interface=FILE β€” dump an interface for these modules into FILE.
  • -l DIR, --lib=DIR β€” where Haddock's auxiliary files live πŸ“
  • -h, --html β€” generate documentation in HTML format. several files get generated into the current directory (or into whatever directory you gave with the -o option), and they include:
    • index.html β€” the top level page of the documentation: lists the modules available, and uses indentation to show the hierarchy if the modules are hierarchical. main character page ngl πŸ‘‘
    • haddock.css β€” the stylesheet the generated HTML uses. feel free to modify this to change the colors or the layout, or even specify your own stylesheet with the --css option. glow-up permitted. πŸ’…
    • module.html β€” an HTML page for each module.
    • doc-index.html, doc-index-XX.html β€” the index, split into two (functions/constructors and types/classes, as per Haskell namespaces) and then split further alphabetically. organized queen. πŸ—‚οΈ
  • --hoogle β€” output for Hoogle
  • --html-help=format β€” produce index and table of contents in mshelp, mshelp2 or devhelp format (with -h)
  • --source-base=URL β€” include links to the source files in the generated documentation, where URL is the base URL where the source files can be found.
  • -s URL, --source-module=URL β€” include links to the source files in the generated documentation, where URL is a source code link for each module (using the %{FILE} or %{MODULE} vars).
  • --source-entity=URL β€” include links to the source files in the generated documentation, where URL is a source code link for each entity (using the %{FILE}, %{MODULE} or %{NAME} vars).
  • --comments-base=URL β€” URL for a comments link on the contents and index pages.
  • --comments-module=URL β€” URL for a comments link for each module (using the %{MODULE} var).
  • --comments-entity=URL β€” URL for a comments link for each entity (using the %{FILE}, %{MODULE} or %{NAME} vars).
  • --css=FILE β€” use the CSS FILE instead of the default stylesheet that comes with haddock for HTML output. it should specify certain classes: see the default stylesheet for details.
  • -p FILE, --prologue=FILE β€” specify a file containing prologue text.
  • -t TITLE, --title=TITLE β€” use TITLE as the page heading for each page in the documentation. this will normally be the name of the library being documented.

the title should be a plain string (no markup please!). keep it simple, bestie. πŸ™ˆ

  • -k NAME, --package=NAME β€” specify the package name (optional).
  • -n, --no-implicit-prelude β€” do not assume Prelude is imported
  • -d, --debug β€” enable extra debugging output. πŸ”
  • -?, --help β€” display help.
  • -V, --version β€” display version.
  • -v, --verbose β€” verbose status reporting. she's chatty. πŸ’¬
  • --use-contents=URL β€” use a separately-generated HTML contents page.
  • --gen-contents β€” generate an HTML contents from specified interfaces.
  • --use-index=URL β€” use a separately-generated HTML index.
  • --gen-index β€” generate an HTML index from specified interfaces.
  • --ignore-all-exports β€” behave as if all modules have the ignore-exports atribute
  • --hide=MODULE β€” behave as if MODULE has the hide attribute.
  • --use-package=PACKAGE β€” the modules being processed depend on PACKAGE.

πŸŽ€ FILES πŸŽ€

  • /usr/bin/haddock
  • /usr/share/haddock-2.6.1/html/plus.gif
  • /usr/share/haddock-2.6.1/html/minus.gif
  • /usr/share/haddock-2.6.1/html/haskell_icon.gif
  • /usr/share/haddock-2.6.1/html/haddock.js
  • /usr/share/haddock-2.6.1/html/haddock.css
  • /usr/share/haddock-2.6.1/html/haddock-DEBUG.css

🌈 SEE ALSO 🌈


Haddock version 2.6.1

Copyright 2006-2010 Simon Marlow <simonmar@microsoft.com>, Dawid Waern <david.waern@gmail.com>. All rights reserved.


🧚 AUTHOR 🧚

This manual page was written by Michael Weber <michaelw@debian.org> for the Debian GNU/Linux system (but may be used by others).


okay that's the whole thing, bestie β€” go document something gorgeous. this was Haddock, version 2.6.1, dated July 2010, and you can find it filed under HADDOCK(1). no cap, ily, bye! πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from