3 #--------------------------------------------------------------------------------------
 
    5 #                Utility script for generation of HTML Doxygen main page.
 
    7 #--------------------------------------------------------------------------------------
 
   12 if [ -z $JPP_DIR ]; then
 
   13     echo "Variable JPP_DIR undefined."
 
   17 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
 
   25 set_variable NUMBER_OF_COLUMNS   3
 
   30     find  $*  -mindepth 1  -executable  ! -regex ".*\.\(\(\|c\|z\)sh\|py\)"  -printf "%f\n"  |  sort
 
   34 function findscripts()
 
   36     find  $*  -mindepth 1  -executable    -regex ".*\.\(\(\|c\|z\)sh\|py\)"  -printf "%f\n"  |  sort
 
   40 function 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'`
 
   70 echo " * \mainpage Documentation"
 
   73 echo " * 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}; }"
 
   79 echo " * <h2>Documents</h2>"
 
   80 echo " * <ul class=\"b\">"
 
   81 for file in `ls ${JPP_DOC}/*`; do
 
   82     if [ -f ${file} ]; then
 
   83         echo " * <li><a href=\"${file##*/}\">${file##*/}</a></li>"
 
   92 echo " * <h2>Applications</h2>"
 
   93 echo " * <ul class=\"b\">"
 
   94 for file in `findapps ${JPP_BIN}`; do
 
   95     echo " * <li><a href=\"#${file}\">${file}</a></li>"
 
  103 echo " * <h2>Scripts</h2>"
 
  104 echo " * <ul class=\"b\">"
 
  105 for file in `findscripts ${JPP_BIN}`; do
 
  106     echo " * <li><a href=\"#${file}\">${file}</a></li>"
 
  114 echo " * <h2>Examples</h2>"
 
  115 echo " * <ul class=\"b\">"
 
  116 for 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>"
 
  127 for 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>"
 
  155 for 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>"
 
  183 for 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>"
 
  227 echo " * \\\\endhtmlonly"