-
Notifications
You must be signed in to change notification settings - Fork 0
/
builddocs.bash
67 lines (52 loc) · 1.89 KB
/
builddocs.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/bash
# Build the Plato documentation.
# Version: 0.1.0.0, 24th September 2008.
# The script should be run from the Plato project directory.
# The resulting documentation is placed in Plato/Documentation/tmp/html.
# This script requires at least doxygen (accessible in the PATH),
# and a help file compiler if a single compiled help file is required,
# in which case the HHC variable should be set accordingly.
PLATOVERSION="Version 0.1.0.0, "`date`
TMPDOCS=./tmp/html
# HHC="C:\Program Files\HTML Help Workshop\hhc.exe"
# The above Windows path needs to be converted to UNIX form, thus:
HHC="/cygdrive/c/Program Files/HTML Help Workshop/hhc"
# Check script is being run from Plato directory.
if test ! -d "Documentation"; then
echo "Please run from the Plato directory."
exit 1
fi
pushd Documentation
# Clean up first.
rm -f -r tmp
# Build the API docs
if ! doxygen plato.doxygen.config; then
echo Running doxygen failed: check it is installed correctly.
popd
exit 1
fi
# Copy additional docs to tmp dir.
cp -f -r docs $TMPDOCS
# Update version number.
sed -i -e "s/PLATOVERSION/$PLATOVERSION/g" $TMPDOCS/docs/Plato.html
# Patch the website files: index.html etc.
cp -f patches/index.html $TMPDOCS
sed -i -e '/<div style="display: block;">/ r patches/tree.html.stub' $TMPDOCS/tree.html
# Patch the Help project files: index.hhp etc.
# Add table of content entries for additional docs to help TOC file.
sed -i -e '/^<UL>/ r patches/index.hhc.stub' $TMPDOCS/index.hhc
# Add additional files to help project file.
cp -f patches/index.hhp.stub $TMPDOCS/index.hhp
find docs -name '*.*' -printf '%p\n' >> $TMPDOCS/index.hhp
pushd $TMPDOCS
ls *.html >> index.hhp
ls *.css >> index.hhp
ls *.gif >> index.hhp
# Compile html into a chm using a Help compiler.
if ! ( "$HHC" index.hhp ); then
if test ! -f "Plato.chm"; then
echo Running help compiler failed: check it is installed correctly.
fi
fi
popd
popd