3#--------------------------------------------------------------------------------------
5# Utility script for generation of HTML Doxygen main page.
7#--------------------------------------------------------------------------------------
12if [ -z $JPP_DIR ]; then
13 echo "Variable JPP_DIR undefined."
17source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
25set_variable NUMBER_OF_COLUMNS 3
26set_variable WORKDIR `mktemp -d ${TMPDIR:-/tmp}/XXXXXX`
31 find $* -mindepth 1 -executable ! -regex ".*\.\(\(\|c\|z\)sh\|py\)" -printf "%f\n" | sort
37 find $* -mindepth 1 -executable -regex ".*\.\(\(\|c\|z\)sh\|py\)" -printf "%f\n" | sort
41function findexamples()
43 find $* -mindepth 1 -executable | sort
47# Method to get file name of source code.
49# \param 1 executable file
54 file=`which $1 2> /dev/null`
56 if [[ -n "${file}" && -x ${file} ]]; then
57 if [[ $file == *\.((|c|z)sh|py) ]]; then
60 source=`${file} -v 2> /dev/null | sed -n 's/source: *//p'`
71echo " * \mainpage Documentation"
74echo " * ul.b { list-style-type: none; counter-reset: section; columns: ${NUMBER_OF_COLUMNS}; -moz-column-count: ${NUMBER_OF_COLUMNS}; -webkit-column-count: ${NUMBER_OF_COLUMNS}; column-count: ${NUMBER_OF_COLUMNS}; }"
80echo " * <h2>Documents</h2>"
81echo " * <ul class=\"b\">"
82for file in `ls ${JPP_DOC}/*`; do
83 if [ -f ${file} ]; then
84 echo " * <li><a href=\"${file##*/}\">${file##*/}</a></li>"
93echo " * <h2>Applications</h2>"
94echo " * <ul class=\"b\">"
95for file in `findapps ${JPP_BIN}`; do
96 echo " * <li><a href=\"#${file}\">${file}</a></li>"
104echo " * <h2>Scripts</h2>"
105echo " * <ul class=\"b\">"
106for file in `findscripts ${JPP_BIN}`; do
107 echo " * <li><a href=\"#${file}\">${file}</a></li>"
115echo " * <h2>Examples</h2>"
116echo " * <ul class=\"b\">"
117for dir in `ls $JPP_DIR/examples`; do
119 if [[ -d $JPP_DIR/examples/${dir} ]]; then
120 echo " * <li><a href=\"#examples/${dir}\">${dir}</a></li>"
132 source=`get_source ${file}`
135 echo " * <h4 id=\"${file}\">"
136 if [[ -n "${source}" ]]; then
137 if (`ls $JPP_DIR/examples/*/${source:t} >& /dev/null`); then
138 source=${source##${JPP_DIR:a}/}
142 echo " * \\\\endhtmlonly"
150 ${file} -h! 2> /dev/null | sed 's/</\</g;s/>/\>/g'
152 echo " * <a href="index.html">Go back to main page.</a>"
157for file in `findapps ${JPP_BIN}`; do
159 makeapp $file > $WORKDIR/${file:t}.txt &
164if (( ${#FS} > 0 )); then
169 rm -f $WORKDIR/${^FS} >& /dev/null
179 source=`eval ls $JPP_DIR/software/*/$file`
182 echo " * <h4 id=\"${file}\">"
183 if [[ -n "${source}" ]]; then
184 if (`ls $JPP_DIR/examples/*/${source:t} >& /dev/null`); then
185 source=${source##${JPP_DIR:a}/}
189 echo " * \\\\endhtmlonly"
197 ${file} -h! 2> /dev/null | sed 's/</\</g;s/>/\>/g'
199 echo " * <a href="index.html">Go back to main page.</a>"
204for file in `findscripts ${JPP_BIN}`; do
206 makescript $file > $WORKDIR/${file:t}.txt &
211if (( ${#FS} > 0 )); then
216 rm -f $WORKDIR/${^FS} >& /dev/null
222function makeexample()
226 if [[ ! $file = *.sh && ! $file = *.csh ]]; then
227 source=`get_source ${file}`
233 echo " * <h4 id=\"${file}\">"
234 if [[ -n "${source}" ]]; then
235 if (`ls ${JPP_DIR}/software/*/${source:t} >& /dev/null`); then
236 source=${source##${JPP_DIR:a}/}
237 elif (( `ls ${JPP_DIR}/examples/*/${source:t} | wc -l` > 1 )); then
238 source=${source##${JPP_DIR:a}/examples/}
242 echo " * \\\\endhtmlonly"
250 ${file} -h! 2>&1 | sed 's/</\</g;s/>/\>/g'
252 echo " * <a href="index.html">Go back to main page.</a>"
255for dir in `ls $JPP_DIR/examples`; do
257 if [[ -d $JPP_DIR/examples/${dir} ]]; then
260 echo " * <h4 id=\"examples/${dir}\">${dir}</h4>"
261 echo " * <ul class=\"b\">"
262 for file in `findexamples $JPP_DIR/examples/${dir}`; do
263 echo " * <li><a href=\"#${file}\">${file:t}</a></li>"
266 echo " * <a href="index.html">Go back to main page.</a>"
270 for file in `findexamples $JPP_DIR/examples/${dir}/`; do
272 makeexample $file > $WORKDIR/${file:t}.txt &
277 if (( ${#FS} > 0 )); then
282 rm -f $WORKDIR/${^FS} >& /dev/null
288echo " * \\\\endhtmlonly"
291rm -rf $WORKDIR >& /dev/null