Changeset 66516


Ignore:
Timestamp:
Oct 16, 2015, 6:53:02 AM (9 years ago)
Author:
wenzeslaus
Message:

refactor out extraction of one line description for addons

Location:
grass-addons/tools/addons
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • grass-addons/tools/addons/grass-addons-index.sh

    r66403 r66516  
    6565    # grass.osgeo.org SERVER
    6666    cd /var/www/grass/grass-cms/grass${major}${minor}/manuals/addons
     67    SRC=${HOME}/src/
    6768
    6869    if test -f index.html ; then
     
    108109<hr>" > index.html
    109110
    110     # fetch one-line descriptions into a separate file:
    111     # let's try to be more robust against missing keywords in a few HTML pages
    112111    prefix_last=""
    113112    for currfile in `ls -1 *.html | grep -v index.html` ; do
     
    125124        module=`echo $currfile | sed 's+\.html$++g'`
    126125        echo "<li style=\"margin-left: 20px\"><a href=\"$currfile\">$module</a>:" >> index.html
    127         grep 'KEYWORDS' $currfile 2> /dev/null > /dev/null
    128         if [ $? -eq 0 ] ; then
    129            # keywords found, so go ahead with extraction of one-line description
    130            cat $currfile | awk '/NAME/,/KEYWORDS/' | grep ' - ' | cut -d'-' -f2- | cut -d'<' -f1 | sed 's+>$+></li>+g'  >> /tmp/d.$TMP
    131            # argh, fake keyword line found (broken manual page or missing g.parser usage)
    132            if [ ! -s /tmp/d.$TMP ] ; then
    133               echo "(incomplete manual page, please fix)" > /tmp/d.$TMP
    134            fi
    135            cat /tmp/d.$TMP >> index.html
    136            rm -f /tmp/d.$TMP
    137         else
    138            # argh, no keywords found (broken manual page or missing g.parser usage)
    139            echo "(incomplete manual page, please fix)" >> index.html
    140         fi
     126        ${SRC}grass-addons/tools/addons/get_page_description.sh $currfile >> index.html
    141127    done
    142128
Note: See TracChangeset for help on using the changeset viewer.