Skip to content

Commit 7d0f009

Browse files
author
chad-iris
committed
Add option to build PDF manual
1 parent df60156 commit 7d0f009

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

doc/build-push-docs.sh

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,38 @@ fi
1414
CURRENT_YEAR=$(date -u +%Y)
1515
CURRENT_DATE=$(date -u +%Y-%m-%d)
1616

17-
# Build extra options for injection into config
18-
DOXYGENCONFIG+="PROJECT_NUMBER=${PROJECT_VERSION}\n"
19-
DOXYGENCONFIG+="ALIASES+=currentyear='${CURRENT_YEAR}'\n"
20-
DOXYGENCONFIG+="ALIASES+=currentdate='${CURRENT_DATE}'\n"
21-
22-
# Documentation build command, injecting current project version
23-
DOCBUILD="(cat Doxyfile; echo -e '${DOXYGENCONFIG}') | doxygen -"
24-
2517
# Check for command line options
26-
while getopts ":YN" o; do
18+
while getopts ":YNP" o; do
2719
case "${o}" in
2820
Y)
2921
PUSHYES=Y
3022
;;
3123
N)
3224
PUSHYES=N
3325
;;
26+
P)
27+
BUILDPDF=Y
28+
;;
3429
*)
35-
echo "Usage: $0 [-Y] [-N]" 1>&2;
30+
echo "Usage: $0 [-Y] [-N] [-P]" 1>&2;
3631
exit 1;
3732
;;
3833
esac
3934
done
4035
shift $((OPTIND-1))
4136

37+
# Build extra options for injection into config
38+
DOXYGENCONFIG+="PROJECT_NUMBER=${PROJECT_VERSION}\n"
39+
DOXYGENCONFIG+="ALIASES+=currentyear='${CURRENT_YEAR}'\n"
40+
DOXYGENCONFIG+="ALIASES+=currentdate='${CURRENT_DATE}'\n"
41+
42+
if [[ "$BUILDPDF" == "Y" ]]; then
43+
DOXYGENCONFIG+="GENERATE_LATEX=YES\n"
44+
fi
45+
46+
# Documentation build command, injecting current project version
47+
DOCBUILD="(cat Doxyfile; echo -e '${DOXYGENCONFIG}') | doxygen -"
48+
4249
# Change to working directory, aka base directory of script
4350
BASEDIR=$(dirname $0)
4451
cd $BASEDIR || { echo "Cannot change-directory to $BASEDIR, exiting"; exit 1; }
@@ -48,8 +55,20 @@ rm -rf $DOCDIR
4855
mkdir $DOCDIR || { echo "Cannot create directory '$DOCDIR', exiting"; exit 1; }
4956

5057
# Build docs
58+
echo "Building docs"
5159
eval $DOCBUILD || { echo "Error running '$DOCBUILD', exiting"; exit 1; }
5260

61+
# Build PDF and copy to current directory
62+
if [[ "$BUILDPDF" == "Y" ]]; then
63+
if [[ -d latex ]]; then
64+
echo "Building PDF"
65+
BUILDPDF=$(cd latex; make pdf 2>&1)
66+
cp latex/refman.pdf libmseed.pdf
67+
else
68+
echo "WARNING: Cannot build PDF, no source latex directory"
69+
fi
70+
fi
71+
5372
GITREMOTE=$(git config --get remote.origin.url)
5473

5574
# Exit if already instructed to not push

0 commit comments

Comments
 (0)