3
# generates HTML man pages docs/html/index.html
4
# (c) The GRASS Development Team, and Markus Neteler, 2003, 2004, 2005, 2006, 2009
6
## TODO: better fix this in include/Make/Html.make, see RT bug #5361
8
# exclude following list of modules from help index:
27
# these modules don't use G_parser()
28
check_for_desc_override()
32
SHORTDESC="Provides automated parser, GUI, and help support for GRASS scipts."
35
SHORTDESC="Raster map calculator."
38
SHORTDESC="3D raster map calculator."
41
SHORTDESC="Support module for r.li landscape index calculations."
47
############# nothing to configure below ############
49
# regex-proof module skip list
50
EXCLUDEHTML="`echo "$EXCLUDEMODS" | tr ' ' '|' | sed -e 's+\.+\\\\.+g' -e 's+|+\\\\|+g'`"
52
#fetch the ARCH for store the files:
53
ARCH="`cat ../include/Make/Platform.make | grep '^ARCH' | sed 's+ ++g' | cut -d'=' -f2`"
55
HTMLDIR="../dist.$ARCH/docs/html"
56
GRASSVERSION=`cat ../dist.$ARCH/etc/VERSIONNUMBER`
57
GRASS_MMVER=`cut -d . -f 1-2 ../dist.$ARCH/etc/VERSIONNUMBER`
58
MACOSX=`echo $ARCH | grep -i darwin`
65
# $3: is it main index
67
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
71
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
72
<meta name=\"Author\" content=\"GRASS Development Team\">" > "$1"
73
if [ "$3" ] && [ "$MACOSX" ] ; then
74
echo " <meta name=\"AppleTitle\" content=\"GRASS GIS $GRASSVERSION Help\">
75
<meta name=\"AppleIcon\" content=\"GRASS-$GRASS_MMVER/grass_icon.png\">
76
<meta name=\"robots\" content=\"anchors\">" >> "$1"
78
echo " <link rel=\"stylesheet\" href=\"grassdocs.css\" type=\"text/css\">
80
<body bgcolor=\"#FFFFFF\">
82
<!-- this file is generated by tools/build_html_index.sh -->
84
<img src=\"grass_logo.png\" alt=\"GRASS logo\"><hr align=center size=6 noshade>
86
<h2>GRASS GIS $GRASSVERSION Reference Manual</h2>
88
<p><b>Geographic Resources Analysis Support System</b>, commonly
89
referred to as <a href=\"http://grass.osgeo.org\">GRASS</a>, is a <a
90
href=\"http://en.wikipedia.org/wiki/Geographic_information_system\">Geographic
91
Information System</a> (GIS) used for geospatial data management and
92
analysis, image processing, graphics/maps production, spatial
93
modeling, and visualization. GRASS is currently used in academic and
94
commercial settings around the world, as well as by many governmental
95
agencies and environmental consulting companies.</p>
97
<p>This reference manual details the use of modules distributed with
98
Geographic Resources Analysis Support System (GRASS), an open source (GNU
99
GPL'ed), image processing and geographic information system (GIS).</p>
105
write_html_cmd_overview()
109
<!-- the files grass6.html & helptext.html file live in lib/init/ -->
110
<table border=\"0\" cellspacing=\"8\" align=\"center\">
113
<td valign=\"top\" bgcolor=\"$BOXCOLOR\" class="box"><h3> Quick Introduction</h3>
115
<li><a href=\"helptext.html\">How to start with GRASS</a></li>
119
<li><a href=\"projectionintro.html\">Intro projections and spatial transformations</a></li>
120
<li><a href=\"rasterintro.html\">Intro 2D raster map processing</a></li>
121
<li><a href=\"raster3dintro.html\">Intro 3D raster map (voxel) processing</a></li>
122
<li><a href=\"imageryintro.html\">Intro image processing</a></li>
123
<li><a href=\"vectorintro.html\">Intro vector map processing and network analysis</a></li>
124
<li><a href=\"databaseintro.html\">Intro database management</a></li>
126
<td valign=\"top\" bgcolor=\"$BOXCOLOR\" class="box"><h3> Display/Graphical User Interfaces</h3>
128
<li><a href=\"wxGUI.html\">wxGUI</a> wxPython-based GUI frontend</li>
129
<li><a href=\"gis.m.html\">gis.m</a> and <a href=d.m.html>d.m</a> TCL/TK-based GUI frontend</li>
133
<li><a href=\"display.html\">Display commands manual</a></li>
134
<li><a href=\"displaydrivers.html\">Display drivers</a></li>
138
<li><a href=\"nviz.html\">nviz</a> 3D visualization and animation tool</li>
139
<li><a href=\"xganim.html\">xganim</a> tool for animating a raster map series</li>
143
<td valign=\"top\" bgcolor=\"$BOXCOLOR\" class="box"><h3> Raster and voxel processing</h3>
145
<li><a href=\"raster.html\">Raster commands manual</a></li>
146
<li><a href=\"raster3D.html\">Raster3D commands manual</a></li>
148
<td valign=\"top\" bgcolor=\"$BOXCOLOR\" class="box"><h3> Image processing</h3>
150
<li><a href=\"imagery.html\">Imagery commands manual</a></li>
154
<td valign=\"top\" bgcolor=\"$BOXCOLOR\" class="box"><h3> Vector processing</h3>
156
<li><a href=\"vector.html\">Vector commands manual</a></li>
158
<td valign=\"top\" bgcolor=\"$BOXCOLOR\" class="box"><h3> Database</h3>
160
<li><a href=\"sql.html\">SQL support in GRASS GIS</a></li>
161
<li><a href=\"database.html\">Database commands manual</a></li>
165
<td valign=\"top\" bgcolor=\"$BOXCOLOR\" class="box"><h3> General</h3>
167
<li><a href=\"grass6.html\">GRASS startup manual page</a></li>
168
<li><a href=\"general.html\">General commands manual</a></li>
170
<td valign=\"top\" bgcolor=\"$BOXCOLOR\" class="box"><h3> Miscellaneous</h3>
172
<li><a href=\"misc.html\">Misc. commands manual</a></li>
173
<li><a href=\"gem/index.html\">The GRASS Extensions Manager (GEM)</a></li>
177
<td valign=\"top\" bgcolor=\"$BOXCOLOR\" class="box"><h3> Variables</h3>
179
<li><a href=\"variables.html\">GRASS variables and environment variables</a></li>
181
<td valign=\"top\" bgcolor=\"$BOXCOLOR\" class="box"><h3> Printing</h3>
183
<li><a href=\"postscript.html\">Postscript commands manual</a></li>
198
<p><a href=\"$2\">Help Index</a> | <a href=\"full_index.html\">Full Index</a><br>
199
© 2003-2010 <a href=\"http://grass.osgeo.org\">GRASS Development Team</a></p>
204
expand_module_class_name()
207
if [ "$1" = "d" ] ; then
209
elif [ "$1" = "db" ] ; then
211
elif [ "$1" = "g" ] ; then
213
elif [ "$1" = "i" ] ; then
215
elif [ "$1" = "m" ] ; then
217
elif [ "$1" = "ps" ] ; then
219
elif [ "$1" = "p" ] ; then
221
elif [ "$1" = "r" ] ; then
223
elif [ "$1" = "r3" ] ; then
225
elif [ "$1" = "s" ] ; then
227
elif [ "$1" = "v" ] ; then
234
#are we in the tools/ dir?
235
ls build_html_index.sh 2> /dev/null
236
if [ $? -eq 1 ] ; then
237
echo "ERROR: this script must be run from the tools/ directory"
241
FULLINDEX=full_index.html
246
cp -f grassdocs.css $HTMLDIR/
247
mkdir -p $HTMLDIR/nviz/
248
cp -f grassdocs.css $HTMLDIR/nviz/
249
chmod a+r $HTMLDIR/grassdocs.css $HTMLDIR/nviz/grassdocs.css
250
#copy over GRASS logo:
251
cp -f grass_logo.png $HTMLDIR/
252
cp -f grass_logo.png $HTMLDIR/nviz/
253
chmod a+r $HTMLDIR/grass_logo.png $HTMLDIR/nviz/grass_logo.png
254
if [ "$MACOSX" ] ; then
255
cp -f grass_icon.png $HTMLDIR/
256
chmod a+r $HTMLDIR/grass_icon.png
259
mkdir -p $HTMLDIR/gem
260
cp -f $GEMDIR/docs/GEM-Manual/*.html $HTMLDIR/gem/
261
cp -f $GEMDIR/docs/GEM-Manual/img* $HTMLDIR/gem/
262
chmod a+r $HTMLDIR/gem/*.html $HTMLDIR/gem/img*
264
#process all HTML pages:
267
#get list of available GRASS modules:
268
CMDLIST=`ls -1 *.*.html | grep -v "$FULLINDEX" | grep -v index.html | \
269
grep -v gis.m.html | grep -v "\($EXCLUDEHTML\)" | cut -d'.' -f1 | sort -u | \
271
CMDLISTNO=`echo $CMDLIST | wc -w | awk '{print $1}'`
274
echo "Generating HTML manual pages index (help system)..."
275
write_html_header "$FULLINDEX" "GRASS GIS $GRASSVERSION Reference Manual: Full index"
276
echo "Go <a href=\"index.html\">back to help overview</a><BR>" >> "$FULLINDEX"
277
echo "<BR><h3>Full command index:</h3>" >> "$FULLINDEX"
279
#generate main index of all modules:
280
echo "[ " >> "$FULLINDEX"
285
echo -n "<b><a href=\"#$i\">$i.*</a></b>" >> "$FULLINDEX"
286
if [ $k -lt $CMDLISTNO ] ; then
287
echo -n " | " >> "$FULLINDEX"
294
echo "<table border=0>" >> "$FULLINDEX"
295
echo "<tr><td> <a href=\"full_index.html#d\">d.*</a> </td><td>display commands</td></tr>" >> "$FULLINDEX"
296
echo "<tr><td> <a href=\"full_index.html#db\">db.*</a> </td><td>database commands</td></tr>" >> "$FULLINDEX"
297
echo "<tr><td> <a href=\"full_index.html#g\">g.*</a> </td><td>general commands</td></tr>" >> "$FULLINDEX"
298
echo "<tr><td> <a href=\"full_index.html#i\">i.*</a> </td><td>imagery commands</td></tr>" >> "$FULLINDEX"
299
echo "<tr><td> <a href=\"full_index.html#m\">m.*</a> </td><td>miscellaneous commands</td></tr>" >> "$FULLINDEX"
300
echo "<tr><td> <a href=\"full_index.html#ps\">ps.*</a> </td><td>postscript commands</td></tr>" >> "$FULLINDEX"
301
echo "<tr><td> <a href=\"full_index.html#r\">r.*</a> </td><td>raster commands</td></tr>" >> "$FULLINDEX"
302
echo "<tr><td> <a href=\"full_index.html#r3\">r3.*</a> </td><td>raster3D commands</td></tr>" >> "$FULLINDEX"
303
echo "<tr><td> <a href=\"full_index.html#v\">v.*</a> </td><td>vector commands</td></tr>" >> "$FULLINDEX"
304
echo "<tr><td> <a href=\"gis.m.html\">gis.m</a> </td><td>GUI frontend to GIS menus and display</td></tr>" >> "$FULLINDEX"
305
echo "<tr><td> <a href=\"nviz.html\">nviz</a> </td><td>visualization suite</td></tr>" >> "$FULLINDEX"
306
echo "<tr><td> <a href=\"wxGUI.html\">wxGUI</a> </td><td>wxPython-based GUI frontend</td></tr>" >> "$FULLINDEX"
307
echo "<tr><td> <a href=\"xganim.html\">xganim</a> </td><td>raster map slideshow</td></tr>" >> "$FULLINDEX"
308
echo "</table>" >> "$FULLINDEX"
311
#for all module groups:
314
echo "<a name=\"$i\"></a>" >> "$FULLINDEX"
315
echo "<BR><h3>$i.* commands:</h3>" >> "$FULLINDEX"
316
echo "<table>" >> "$FULLINDEX"
319
for i in `ls -1 $i.*.html | grep -v "\($EXCLUDEHTML\)"`
321
BASENAME=`basename $i .html`
322
SHORTDESC="`cat $i | awk '/NAME/,/SYNOPSIS/' | grep '<em>' | cut -d'-' -f2- | sed 's+^ ++g' | grep -vi 'SYNOPSIS' | head -n 1`"
323
check_for_desc_override
324
echo "<tr><td valign="top"><a href=\"$i\">$BASENAME</a></td> <td>$SHORTDESC</td></tr>" >> "$FULLINDEX"
326
echo "</table>" >> "$FULLINDEX"
329
write_html_footer "$FULLINDEX" index.html
332
#next write separate module pages:
333
#for all module groups:
336
MODCLASS=`expand_module_class_name $k`
337
FILENAME=$MODCLASS.html
339
write_html_header "$FILENAME" "GRASS GIS $GRASSVERSION Reference Manual: $MODCLASS"
340
echo "Go <a href=\"index.html\">back to help overview</a><BR><BR><BR>" >> "$FILENAME"
342
echo "<b>$MODCLASS commands:</b>" >> "$FILENAME"
343
echo "<table>" >> "$FILENAME"
345
for k in `ls -1 $k.*.html | grep -v "\($EXCLUDEHTML\)"`
347
BASENAME=`basename $k .html`
348
SHORTDESC="`cat $k | awk '/NAME/,/SYNOPSIS/' | grep '<em>' | cut -d'-' -f2- | sed 's+^ ++g' | grep -vi 'SYNOPSIS' | head -n 1`"
349
check_for_desc_override
350
echo "<tr><td valign="top"><a href=\"$k\">$BASENAME</a></td> <td>$SHORTDESC</td></tr>" >> "$FILENAME"
353
echo "</table>" >> "$FILENAME"
355
write_html_footer "$FILENAME" index.html
358
#next write main page:
360
write_html_header "$FILENAME" "GRASS GIS $GRASSVERSION Reference Manual" 1
361
write_html_cmd_overview "$FILENAME"
363
#insert a special comment so that GEM will know where to merge docs of extensions
365
echo "<!-- GEM Extensions StartHTML. Do not delete or change this comment! -->" >> "$FILENAME"
370
write_html_footer "$FILENAME" index.html
373
echo "Generated HTML docs in $HTMLDIR/index.html"
374
echo "----------------------------------------------------------------------"
375
echo "Following modules are missing the 'description.html' file in src code:"
376
for i in `find . -name "*.*.html" | sort | grep -v "$FULLINDEX" | grep -v 'index.html' | grep -v "$EXCLUDEHTML"`
378
if grep 'DESCRIPTION' $i >/dev/null 2>&1 ; then
381
echo `echo $i | sed 's?./??' | sed 's/.html//'`
384
echo "----------------------------------------------------------------------"