#!/bin/sh
#
# Retrieve the name of the HTML page containing anchor $2
# and output it back
# Default to "index" if none was found
# $1 is the name of the documentation to search in (user-manual,
#   developer-guide or packager-guide)
# $2 is the anchor name to search for


RESULT=`grep "id=\"$2" $1.chunked/* | cut -f1 -d':'`

if test -z $RESULT ; then
	echo "index"
else
	echo $RESULT
fi
