forked from GaloisInc/saw-script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen-doc
More file actions
executable file
·33 lines (23 loc) · 694 Bytes
/
gen-doc
File metadata and controls
executable file
·33 lines (23 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
ABS_IX=$PWD/doc/haddock
for i in $*; do
echo Generating documenation for $i
cabal new-haddock \
--haddock-hyperlink-source \
--haddock-options "--use-index=$ABS_IX/doc-index.html --use-contents=$ABS_IX/index.html" $i
done
GHC_VERSION=$(ghc --numeric-version)
if [ ${GHC_VERSION}x == "x" ]; then
echo Failed to guess version of GHC.
exit 1
fi
echo Generating TOC and index \(GHC $GHC_VERSION\)
for i in $(find . -name '*.haddock' | grep $GHC_VERSION); do
DIR=../../$(dirname $i)
OPTS="$OPTS --read-interface=$DIR,$DIR/$(basename $i)"
done
mkdir -p $ABS_IX
cd $ABS_IX
haddock $OPTS --gen-index --gen-contents
echo Documentation index is in:
echo $ABS_IX