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
30 find $* -mindepth 1 -executable ! -regex ".*\.\(\(\|c\|z\)sh\|py\)" -printf "%f\n" | sort
36 find $* -mindepth 1 -executable -regex ".*\.\(\(\|c\|z\)sh\|py\)" -printf "%f\n" | sort
40function findexamples()
42 find $* -mindepth 1 -executable | sort
46# Method to get file name of source code.
48# \param 1 executable file
53 file=`which $1 2> /dev/null`
55 if [[ -n "${file}" && -x ${file} ]]; then
56 if [[ $file == *\.((|c|z)sh|py) ]]; then
59 source=`${file} -v 2> /dev/null | sed -n 's/source: *//p'`
70echo " * \mainpage Documentation"
73echo " * 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}; }"
79echo " * <h2>Documents</h2>"
80echo " * <ul class=\"b\">"
81for file in `ls ${JPP_DOC}/*`; do
82 if [ -f ${file} ]; then
83 echo " * <li><a href=\"${file##*/}\">${file##*/}</a></li>"
92echo " * <h2>Applications</h2>"
93echo " * <ul class=\"b\">"
94for file in `findapps ${JPP_BIN}`; do
95 echo " * <li><a href=\"#${file}\">${file}</a></li>"
103echo " * <h2>Scripts</h2>"
104echo " * <ul class=\"b\">"
105for file in `findscripts ${JPP_BIN}`; do
106 echo " * <li><a href=\"#${file}\">${file}</a></li>"
114echo " * <h2>Examples</h2>"
115echo " * <ul class=\"b\">"
116for dir in `ls $JPP_DIR/examples`; do
118 if [[ -d $JPP_DIR/examples/${dir} ]]; then
119 echo " * <li><a href=\"#examples/${dir}\">${dir}</a></li>"
127for file in `findapps ${JPP_BIN}`; do
129 source=`get_source ${file}`
132 echo " * <h4 id=\"${file}\">"
133 if [[ -n "${source}" ]]; then
134 if (`ls $JPP_DIR/examples/*/${source:t} >& /dev/null`); then
135 source=${source##${JPP_DIR:a}/}
139 echo " * \\\\endhtmlonly"
147 ${file} -h! 2> /dev/null | sed 's/</\</g;s/>/\>/g'
149 echo " * <a href="#top">Go back to top of page.</a>"
155for file in `findscripts ${JPP_BIN}`; do
157 source=`eval ls $JPP_DIR/software/*/$file`
160 echo " * <h4 id=\"${file}\">"
161 if [[ -n "${source}" ]]; then
162 if (`ls $JPP_DIR/examples/*/${source:t} >& /dev/null`); then
163 source=${source##${JPP_DIR:a}/}
167 echo " * \\\\endhtmlonly"
175 ${file} -h! 2> /dev/null | sed 's/</\</g;s/>/\>/g'
177 echo " * <a href="#top">Go back to top of page.</a>"
183for dir in `ls $JPP_DIR/examples`; do
185 if [[ -d $JPP_DIR/examples/${dir} ]]; then
188 echo " * <h4 id=\"examples/${dir}\">${dir}</h4>"
189 echo " * <ul class=\"b\">"
190 for file in `findexamples $JPP_DIR/examples/${dir}`; do
191 echo " * <li><a href=\"#${file}\">${file:t}</a></li>"
194 echo " * <a href="#top">Go back to top of page.</a>"
196 for file in `findexamples $JPP_DIR/examples/${dir}/`; do
198 if [[ ! $file = *.sh && ! $file = *.csh ]]; then
199 source=`get_source ${file}`
205 echo " * <h4 id=\"${file}\">"
206 if [[ -n "${source}" ]]; then
207 if (`ls ${JPP_DIR}/software/*/${source:t} >& /dev/null` || `ls ${JPP_DIR}/examples/^${dir}/${source:t} >& /dev/null`); then
208 source=${source##${JPP_DIR:a}/}
212 echo " * \\\\endhtmlonly"
220 ${file} -h! 2>&1 | sed 's/</\</g;s/>/\>/g'
222 echo " * <a href="#top">Go back to top of page.</a>"
227echo " * \\\\endhtmlonly"