summaryrefslogtreecommitdiff
path: root/src/haddock
diff options
context:
space:
mode:
authorpeb <unknown>2005-02-03 14:13:35 +0000
committerpeb <unknown>2005-02-03 14:13:35 +0000
commit4a5a48157fc85f7bb4deaf446140b1178a666f24 (patch)
tree077a81d46fa364559e6b6c1531057aff9b9517fa /src/haddock
parenta7b25a9ca45c7ab7e4c64823698541122a0c865d (diff)
"Committed_by_peb"
Diffstat (limited to 'src/haddock')
-rw-r--r--src/haddock/haddock-script.csh81
-rw-r--r--src/haddock/resources/blank.html10
-rw-r--r--src/haddock/resources/index.html14
3 files changed, 105 insertions, 0 deletions
diff --git a/src/haddock/haddock-script.csh b/src/haddock/haddock-script.csh
new file mode 100644
index 000000000..90825e4d3
--- /dev/null
+++ b/src/haddock/haddock-script.csh
@@ -0,0 +1,81 @@
+#!/bin/tcsh
+
+######################################################################
+# Author: Peter Ljunglöf
+# Time-stamp: "2005-02-03, 16:05"
+# CVS $Date: 2005/02/03 15:13:36 $
+# CVS $Author: peb $
+#
+# a script for producing documentation through Haddock
+######################################################################
+
+set base = `pwd`
+set docdir = $base/haddock
+set resourcedir = $base/haddock-resources
+
+set dirs = (. api compile grammar infra shell source canonical useGrammar cf newparsing parsers notrace cfgm speech visualization for-ghc)
+set rmfiles = {Lex,Par}{CFG,GF,GFC}.hs
+
+######################################################################
+
+echo 0. Cleaning Haddock directory
+
+rm $docdir/*
+
+######################################################################
+
+echo 1. Selecting and copying Haskell files
+
+foreach d ($dirs)
+ echo -- Directory: $d
+ cd $base/$d
+ foreach f (*.hs)
+ tr "\240" " " < $f > $docdir/$f
+ end
+end
+
+######################################################################
+
+echo
+echo 2. Removing unnecessary files
+
+cd $docdir
+echo -- `ls $rmfiles`
+rm $rmfiles
+
+######################################################################
+
+echo
+echo 3. Invoking Haddock
+
+cd $docdir
+haddock -h -t 'Grammatical Framework' *.hs
+
+######################################################################
+
+echo
+echo 4. Restructuring to HTML framesets
+
+cd $docdir
+echo -- Substituting for frame targets inside html files
+mv index.html index-frame.html
+foreach f (*.html)
+ perl -pe 's/<HEAD/<HEAD><BASE TARGET="contents"/; s/"index.html"/"index-frame.html"/; s/(<A HREF = "\S*index\S*.html")/$1 TARGET="index"/' $f > tempfile
+ mv tempfile $f
+end
+
+cd $resourcedir
+echo -- Copying resource files:
+echo -- `ls`
+cp * $docdir
+
+######################################################################
+
+echo
+echo 5. Finished
+echo -- The documentation is located at:
+echo -- $docdir/index.html
+
+cd $base
+
+
diff --git a/src/haddock/resources/blank.html b/src/haddock/resources/blank.html
new file mode 100644
index 000000000..63ab0b172
--- /dev/null
+++ b/src/haddock/resources/blank.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+
+<!-- Time-stamp: "2005-02-03, 15:59" -->
+<HTML>
+<HEAD>
+<LINK HREF="haddock.css" REL=stylesheet>
+</HEAD>
+<BODY>
+</BODY>
+</HTML>
diff --git a/src/haddock/resources/index.html b/src/haddock/resources/index.html
new file mode 100644
index 000000000..5d8822dc5
--- /dev/null
+++ b/src/haddock/resources/index.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
+ "http://www.w3.org/TR/html4/frameset.dtd">
+
+<!-- Time-stamp: "2005-02-03, 15:53" -->
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+<title>Grammatical Framework programmer's documentation</title>
+</head>
+<frameset cols="1*,2*">
+ <frame name="index" src="index-frame.html">
+ <frame name="contents" src="blank.html">
+</frameset>
+</html>