Commit 4d0d0e54 authored by Simon Marlow's avatar Simon Marlow
Browse files

fix the links in the library documentation index

parent f6e429f8
...@@ -285,7 +285,7 @@ $(foreach SUBDIR,$(SUBDIRS),$(SUBDIR)/GNUmakefile):\ ...@@ -285,7 +285,7 @@ $(foreach SUBDIR,$(SUBDIRS),$(SUBDIR)/GNUmakefile):\
.PHONY: doc .PHONY: doc
doc: $(foreach SUBDIR,$(SUBDIRS),doc.library.$(SUBDIR)) doc: $(foreach SUBDIR,$(SUBDIRS),doc.library.$(SUBDIR))
sh gen_contents_index sh gen_contents_index --inplace
$(foreach SUBDIR,$(SUBDIRS),doc.library.$(SUBDIR)):\ $(foreach SUBDIR,$(SUBDIRS),doc.library.$(SUBDIR)):\
doc.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \ doc.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
......
...@@ -2,12 +2,34 @@ ...@@ -2,12 +2,34 @@
set -e set -e
if [ -e base/dist ] HADDOCK_ARGS=
then NAMES=
HADDOCK_FILES=`ls -1 */dist/doc/html/*/*.haddock | sort`
else 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` 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 # Automagically create the prologue for the combined index via a
# header, the package prologues (in alphabetical order of the # header, the package prologues (in alphabetical order of the
...@@ -16,15 +38,13 @@ fi ...@@ -16,15 +38,13 @@ fi
cat libraries-header.txt cat libraries-header.txt
echo echo
# Hack to find out if we're in a build tree or installed docs # 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 do
NAME=`echo "$HADDOCK_FILE" | sed "s#/.*##"`
if [ "$NAME" != haskell98 ] if [ "$NAME" != haskell98 ]
then then
echo "[@${NAME}@]" echo "[@${NAME}@]"
grep -v '^ *$$' "$NAME"/prologue.txt grep -v '^ *$$' "$NAME"/prologue.txt
echo echo
HADDOCK_ARGS="$HADDOCK_ARGS --read-interface=$NAME,$HADDOCK_FILE"
fi fi
done done
cat libraries-footer.txt cat libraries-footer.txt
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment