[signifigantly improve documentation, create man page from markdown manual.
John Meacham <john@repetae.net>**20090317013737
 Ignore-this: 2f6178a662b3932765fb84f249857065
] hunk ./Makefile.am 110
-jhc.1: drift_processed/Options.hs
-	$(MAKE) $(AM_MAKEFLAGS) jhc$(EXEEXT)
-	help2man -N --output=jhc.1 ./jhc$(EXEEXT)
-
hunk ./Makefile.am 168
-rpmbuild: jhc.spec dist
-	cp jhc-$(VERSION).tar.gz $(HOME)/var/rpm/SOURCES/jhc-$(VERSION).tar.gz
-	rpmbuild -ba $<
-
-rpm: rpmbuild
-	mkdir -p drop
-	mv jhc-$(VERSION).tar.gz drop/jhc-$(VERSION).tar.gz
-	mv ~/var/rpm/RPMS/*/jhc-$(VERSION)-$(RPMRELEASE).*.rpm drop
-	mv ~/var/rpm/SRPMS/jhc-$(VERSION)-$(RPMRELEASE).src.rpm drop
-
-publish:
hunk ./Makefile.am 238
+jhc_man.mkd: utils/stitch.prl FlagDump.mkd FlagOpts.mkd options.mkd docs/man_header.mkd
+	find . ! -wholename '*/test/*'  ! -wholename '*/_darcs/*' ! -wholename '*/drift_processed/*'  ! -wholename '*/regress/*'  \( -name '*.hs' -o -name '*.hsc' -o -name '*.mkd' -o -wholename '*/data/rts/*.c' \) | xargs perl utils/stitch.prl -h docs/man_header.mkd -c Using,Options > $@
+
hunk ./Makefile.am 246
-	pandoc manual.mkd --toc -s -f markdown -t html -s -c wiki.css -o $@
+	pandoc manual.mkd --toc -s -f markdown -t html -s -c manual.css -o $@
+
+jhc.1 : jhc_man.mkd
+	pandoc $< -s -f markdown -t man -s  -o $@
hunk ./docs/make.mkd 3
-# Building Projects With make
+# Building Projects
hunk ./docs/make.mkd 5
-Using make to build projects with jhc is straightforward, simply add a line like the following in your Makefile
+Jhc does its own dependency chasing to track down source files, you need only
+provide it with the file containing your 'main' function on the command line.
+For instance, if you had a program 'HelloWorld.hs', the following would compile
+it to an executable named 'hello'.
hunk ./docs/make.mkd 10
+    ; jhc -v HelloWorld.hs -o hello
hunk ./docs/make.mkd 12
-    % : %.hs
-            jhc -v $< -o $@
+Libraries are built by passing jhc a file describing the library via the
+--build-hl option. The file format is a simplified version of the cabal format.
+The name of the generated file will be <basename>-<version>.hl.
hunk ./docs/make.mkd 16
-If you wish jhc to automatically generate dependency information, you can do the following
+    ; jhc -v --build-hl mylibrary.cabal
hunk ./docs/make.mkd 18
-    % : %.hs
-            jhc --deps depend.make -v $< -o $@
+
+# installing and using libraries
+
+jhc libraries are distributed as files with an 'hl' suffix, such as
+'base-1.0.hl'. You simply need to drop this file somewhere that jhc can find
+it. for instance, $HOME/lib/jhc. You can then set $JHCLIBPATH to said
+directory, or specify it on the command line with the '-L' option. Extra
+libraries are specified on the command line with the '-p' option.
+
+    ; jhc -v -L/home/john/devel/jhc -pmylibrary MyProgram.hs -o myprogram
hunk ./docs/make.mkd 29
-    -include depend.make
hunk ./docs/make.mkd 31
+# Building Projects With make
+
+Using make to build projects with jhc is straightforward, simply add a line like the following in your Makefile
+
+
+    % : %.hs
+            jhc -v $< -o $@
+
+Or, to build a library, something similar to this will do.
addfile ./docs/man_header.mkd
hunk ./docs/man_header.mkd 1
+
+# NAME
+
+    jhc - jhc haskell compiler
+
+# SYNOPSIS
+
+    jhc [OPTION ..] Main.hs -o main
+
+
addfile ./docs/manual.css
hunk ./docs/manual.css 1
+
+th { border-bottom: black 1px solid; }
+img {
+    border: #777777 1px solid;
+    padding: 0.5em;
+    margin-left: 1em;
+    margin-right: 2em;
+    background-color: #e6e6e6;
+    color: black;
+}
+
+
+
+body {
+    background:#fff;
+    padding:2% 5%;
+    margin:0;
+}
+
+a {
+    text-decoration:none;
+    font-weight:bold;
+    color:#c00;
+}
+
+a:visited { color:#c55; }
+
+a:hover {
+    background:#000000;
+    color:#FFFFFF;
+}
+
+div#toc {
+    border: #777777 1px solid;
+    padding: 0.5em;
+    margin-left: 1em;
+    margin-right: 2em;
+
+}
+
+h1, h2, h3, h4, h1 a, h2 a, h3 a, h4 a { color:#666; }
+h1, h2, h3, h4 { font-size:medium; margin:4ex 0 1ex 0; padding:0; }
+h1, h2 { border-bottom: 2px solid #000; }
+h3 { border-bottom: 1px dashed #000; }
+h1 { font-size:large; border-bottom: 3px solid #000; margin:4ex 0 1ex 0; padding:0;}
+
+div.header h1 {
+    font-size:xx-large; margin-top:1ex;
+    border-bottom: 5px solid #000;
+}
+
+hr {
+    border:none;
+    color:black;
+    background-color:#000;
+    height:2px;
+    margin-top:2ex;
+}
+
+pre {
+    border: #777777 1px solid;
+    padding: 0.5em;
+    margin-left: 1em;
+    margin-right: 2em;
+    white-space: pre;
+    background-color: #e6e6e6;
+    color: black;
+}
+
hunk ./utils/stitch.prl 6
-my @order = qw(
+use Getopt::Std;
+
+my %o;
+getopts('h:c:',\%o) or die "unknown option";
+
+my @order = $o{c} ? split /,/,$o{c} : qw(
hunk ./utils/stitch.prl 43
+print "% Jhc User's Manual\n";
+print "% John Meacham\n\n";
+
+if($o{h}) {
+    open my $h,"<",$o{h} or die "$!: couldn't open $o{h}";
+    print (<$h>);
+}
+