rwh
rwh copied to clipboard
Real World Haskell
On Debian:
apt-get install openjade1.3 xmlto sgml2x docbook-xml docbook-dsssl docbook-utils
On Fedora:
docbook-style-dsssl docbook-utils
On OpenBSD:
docbook-dsssl docbook xmlto openjade
Hackage packages needed to build examples (assuming you're using GHC 6.6.1 or newer):
polyparse-1.1 HaXml-1.19.4 HDBC-1.1.4.0 HDBC-sqlite3-1.1.4.0
Submitting keysigned patches:
darcs get http://darcs.realworldhaskell.org/rwh
Hack away. To apply changes to the repo:
darcs send --sign
The XML validator will be run on any submission. If XML validation fails, the bundle will be rejected (you will be notified of this).
After your patches are applied, the online HTML and PDF versions of the document will be automatically updated. See http://darcs.realworldhaskell.org/ for links to them.
To make a GPG key, run:
gpg --gen-key
Then just:
gpg --export -a [email protected] > /tmp/foo
where [email protected] is your email address (that you entered during --gen-key)
For source code, just write source files in an examples/ch* directory and insert snippets directives. They'll get turned into XML entities that you can refer to.
For example, if you have a file named examples/ch99/Mumble.hs you can put a hunk of code in it like this:
{-- snippet fnord --} blah = blorg {-- /snippet fnord --}
Then, within the docbook, include it as follows:
&Mumble.hs:fnord;
It will be formatted all pretty-like. If you need to include the same snippet a second time for some reason, append ".noid" onto the name:
&Mumble.hs:fnord.noid;
You can use the same scheme to include snippets of C, C++, and Java too, with /** snippet flobber */ as the syntax.
For interaction with ghci, put your directives in a .ghci file. Look at an existing ghci file to figure the syntax out. Inclusion by reference as per .hs snippets.