diff --git a/Makefile b/Makefile index 68afd3c..f9ce9bf 100644 --- a/Makefile +++ b/Makefile @@ -48,9 +48,21 @@ all-cgtests: $(cgtests_targets) clean-cgtests: rm -f cgtests/cgtest?? cgtests/*.tock.* +#Haddock does allow you to customise the description section of a file, but only with more Haskell comments +#Since I want to use an HTML description (with links to SVG using object tags) I have to perform the following hack +#to use my own custom HTML description. Fixes to make the hack nicer are welcome :-) + haddock: @mkdir -p doc - haddock -o doc --html $(filter-out LexOccam.hs LexRain.hs,$(sources)) + @echo "putmycustomdocumentationhere" > .temp-haddock-file + haddock -o doc --html -p temp-haddock-file -t Tock $(filter-out LexOccam.hs LexRain.hs,$(sources)) + cp docextra/*.svg doc/ + @rm .temp-haddock-file + @grep -B 10000 putmycustomdocumentationhere doc/index.html | sed "s/putmycustomdocumentationhere//" > doc/index.html-2 + @cat docextra/description.html >> doc/index.html-2 + @grep -A 10000 putmycustomdocumentationhere doc/index.html | tail -n +2 >> doc/index.html-2 + @rm doc/index.html + @mv doc/index.html-2 doc/index.html clean: rm -f $(targets) *.o *.hi diff --git a/docextra/description.html b/docextra/description.html new file mode 100644 index 0000000..4c42840 --- /dev/null +++ b/docextra/description.html @@ -0,0 +1,14 @@ +
+This is the generated API documentation for the Tock compiler. +
+ ++Below is a rough diagram of the structure of Tock. On the left are the front-ends, in the middle are the common passes, and on the right are the back-ends. +
+ diff --git a/docextra/tock-passes.svg b/docextra/tock-passes.svg new file mode 100644 index 0000000..d6de8cd --- /dev/null +++ b/docextra/tock-passes.svg @@ -0,0 +1,398 @@ + + +