summaryrefslogtreecommitdiff
path: root/libraries/gen_contents_index
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-10-25 15:22:45 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-10-25 15:22:45 +0000
commit4d0d0e543940806dced227d628eca3bb0c1e4e27 (patch)
treec646a418070da20bd937747d43a77d0f19804d63 /libraries/gen_contents_index
parentf6e429f8f5a533d699a69ffc733a56be5ddff5a9 (diff)
downloadhaskell-4d0d0e543940806dced227d628eca3bb0c1e4e27.tar.gz
fix the links in the library documentation index
Diffstat (limited to 'libraries/gen_contents_index')
-rw-r--r--libraries/gen_contents_index36
1 files changed, 28 insertions, 8 deletions
diff --git a/libraries/gen_contents_index b/libraries/gen_contents_index
index bd628ba551..393a8790fc 100644
--- a/libraries/gen_contents_index
+++ b/libraries/gen_contents_index
@@ -2,12 +2,34 @@
set -e
-if [ -e base/dist ]
-then
- HADDOCK_FILES=`ls -1 */dist/doc/html/*/*.haddock | sort`
-else
+HADDOCK_ARGS=
+NAMES=
+
+case $* in
+--inplace)
+ GHC_PKG=../utils/ghc-pkg/ghc-pkg-inplace
+ for DIR in */
+ do
+ NAME=${DIR%/}
+ HADDOCK_FILE=$NAME/dist/doc/html/$NAME/$NAME.haddock
+ if [ -f $HADDOCK_FILE ]
+ then
+ FULLNAME=$NAME-`$GHC_PKG field $NAME version | sed 's#^version: *##'`
+ HADDOCK_ARGS="$HADDOCK_ARGS --read-interface=$FULLNAME,$HADDOCK_FILE"
+ NAMES="$NAMES $NAME"
+ fi
+ done
+ ;;
+*)
HADDOCK_FILES=`ls -1 */*.haddock | sort`
-fi
+ for HADDOCK_FILE in $HADDOCK_FILES
+ do
+ NAME=`echo "$HADDOCK_FILE" | sed "s#/.*##"`
+ HADDOCK_ARGS="$HADDOCK_ARGS --read-interface=$NAME,$HADDOCK_FILE"
+ NAMES="$NAMES $NAME"
+ done
+ ;;
+esac
# Automagically create the prologue for the combined index via a
# header, the package prologues (in alphabetical order of the
@@ -16,15 +38,13 @@ fi
cat libraries-header.txt
echo
# Hack to find out if we're in a build tree or installed docs
- for HADDOCK_FILE in $HADDOCK_FILES
+ for NAME in $NAMES
do
- NAME=`echo "$HADDOCK_FILE" | sed "s#/.*##"`
if [ "$NAME" != haskell98 ]
then
echo "[@${NAME}@]"
grep -v '^ *$$' "$NAME"/prologue.txt
echo
- HADDOCK_ARGS="$HADDOCK_ARGS --read-interface=$NAME,$HADDOCK_FILE"
fi
done
cat libraries-footer.txt