aboutsummaryrefslogtreecommitdiffhomepage
path: root/build_tools/build_documentation.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build_tools/build_documentation.sh')
-rwxr-xr-xbuild_tools/build_documentation.sh22
1 files changed, 16 insertions, 6 deletions
diff --git a/build_tools/build_documentation.sh b/build_tools/build_documentation.sh
index 76c19a04..77eaad68 100755
--- a/build_tools/build_documentation.sh
+++ b/build_tools/build_documentation.sh
@@ -37,10 +37,12 @@ resolve_path()
# Expand relative paths
DOXYFILE=`resolve_path "$DOXYFILE"`
INPUTDIR=`resolve_path "$INPUTDIR"`
+INPUTFILTER=`resolve_path "$INPUT_FILTER"`
OUTPUTDIR=`resolve_path "$OUTPUTDIR"`
echo " doxygen file: $DOXYFILE"
echo " input directory: $INPUTDIR"
+echo " input filter: $INPUTFILTER"
echo " output directory: $OUTPUTDIR"
echo " skipping: $CONDEMNED_PAGES"
@@ -66,6 +68,12 @@ if test -z "$DOXYGENPATH"; then
exit 0
fi
+# Check we have the lexicon filter
+if test -z "$INPUT_FILTER"; then
+ echo >&2 "Lexicon filter is not available. Continuing without."
+ INPUTFILTER=''
+fi
+
# Determine where our output should go
if ! mkdir -p "${OUTPUTDIR}" ; then
echo "Could not create output directory '${OUTPUTDIR}'"
@@ -86,7 +94,8 @@ done
# Input is kept as . because we cd to the input directory beforehand
# This prevents doxygen from generating "documentation" for intermediate directories
DOXYPARAMS=$(cat <<EOF
-PROJECT_NUMBER=2.0.0
+PROJECT_NUMBER=$PROJECT_NUMBER
+INPUT_FILTER=$INPUTFILTER
INPUT=.
OUTPUT_DIRECTORY=$OUTPUTDIR
QUIET=YES
@@ -100,7 +109,7 @@ find "${OUTPUTDIR}" -name "*.1" -delete
# Run doxygen
cd "$TMPLOC"
-(cat "${DOXYFILE}" ; echo "$DOXYPARAMS";) | "$DOXYGENPATH" -
+(cat "${DOXYFILE}" ; echo "$DOXYPARAMS";) | "$DOXYGENPATH" -
# Remember errors
RESULT=$?
@@ -110,15 +119,16 @@ if test "$RESULT" = 0 ; then
# Postprocess the files
for i in "$INPUTDIR"/*.txt; do
- # It would be nice to use -i here for edit in place, but that is not portable
+ # It would be nice to use -i here for edit in place, but that is not portable
CMD_NAME=`basename "$i" .txt`;
- sed -e "s/\(.\)\\.SH/\1/" -e "s/$CMD_NAME *\\\\- *\"\(.*\)\"/\1/" "${CMD_NAME}.1" > "${CMD_NAME}.1.tmp"
+ sed < ${CMD_NAME}.1 > ${CMD_NAME}.1.tmp \
+ -e "/.SH \"$CMD_NAME/d" \
+ -e "s/^$CMD_NAME * \\\- \([^ ]*\) /\\\fB\1\\\fP -/"
mv "${CMD_NAME}.1.tmp" "${CMD_NAME}.1"
done
-
+
# Erase condemned pages
rm -f $CONDEMNED_PAGES
-
fi
# Destroy TMPLOC