forked from dials/cbflib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-docs.sh
74 lines (68 loc) · 4.04 KB
/
make-docs.sh
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
67
68
69
70
71
72
73
#! /bin/bash
# by J. Sloan of Diamond Light Source
# **********************************************************************
# * *
# * YOU MAY REDISTRIBUTE THE CBFLIB PACKAGE UNDER THE TERMS OF THE GPL *
# * *
# * ALTERNATIVELY YOU MAY REDISTRIBUTE THE CBFLIB API UNDER THE TERMS *
# * OF THE LGPL *
# * *
# **********************************************************************
# * *
# * This program is free software; you can redistribute it and/or *
# * modify it under the terms of the GNU General Public License as *
# * published by the Free Software Foundation; either version 2 of *
# * (the License, or (at your option) any later version. *
# * *
# * This program is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU General Public License for more details. *
# * *
# * You should have received a copy of the GNU General Public License *
# * along with this program; if not, write to the Free Software *
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA *
# * 02111-1307 USA *
# * *
# **********************************************************************
# * *
# * This library is free software; you can redistribute it and/or *
# * modify it under the terms of the GNU Lesser General Public *
# * License as published by the Free Software Foundation; either *
# * version 2.1 of the License, or (at your option) any later version. *
# * *
# * This library is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
# * Lesser General Public License for more details. *
# * *
# * You should have received a copy of the GNU Lesser General Public *
# * License along with this library; if not, write to the Free *
# * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
# * MA 02110-1301 USA *
# * *
# **********************************************************************
# This script controls documentaion extraction, pre-processing & construction.
# It should be called as './make-docs.sh [0|1]', where the argument defines
# the output mode and defaults to 0. An output mode of 0 is a 'compatibility
# mode' to generate output to be copied & pasted into CBFlib.html. An output
# mode of 1 is a 'readability mode' which adds some extra information and a
# few formatting improvements that I commonly use in HTML.
# This should be re-written in python to provide some more complex pre-processing.
if (( $# < 1 ))
then
mode=0
else
mode=$1
fi
echo "Running 'doxygen'..."
doxygen doc/src/config &>/dev/null
echo "Extracting data..."
xsltproc -o doc/doc.xml doc/src/doxygen2xml.xsl doc/src/data.xml
echo "processing escape sequences..."
sed -i 's/\\\*/\*/g;s/\\\//\//g' doc/doc.xml
echo "Indexing..."
xsltproc -o doc/doc.xml doc/src/index.xsl doc/doc.xml
echo "Generating HTML..."
xsltproc --stringparam mode $mode -o doc/doc.html doc/src/xml2html.xsl doc/src/data.xml
echo "Done."