[GRASS-SVN] r64109 - in grass/trunk: include/Make man raster3d tools

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jan 12 18:32:30 PST 2015


Author: wenzeslaus
Date: 2015-01-12 18:32:30 -0800 (Mon, 12 Jan 2015)
New Revision: 64109

Modified:
   grass/trunk/include/Make/Docs.make
   grass/trunk/man/Makefile
   grass/trunk/man/build_class.py
   grass/trunk/man/build_full_index.py
   grass/trunk/man/build_html.py
   grass/trunk/raster3d/raster3dintro.html
   grass/trunk/tools/mkhtml.py
Log:
use raster3d instead of raster3D for r3. module family/class keyword

 * use 3D raster for titles and links
 * stay with raster3d keyword in modules (alternatives would be raster_3d and 3D raster, the later may need some special handing to remove number from beginning of file, just to be sure)
 * also use index rather then Index for keywords index link in modules (other links use index but index pages actually use Index)
 * it's unclear if we are using 'Title Case' or just 'Capital at the beginning', also cases such as PostScript and misc are unclear
 * see also #2409 and r64055


Modified: grass/trunk/include/Make/Docs.make
===================================================================
--- grass/trunk/include/Make/Docs.make	2015-01-12 22:53:36 UTC (rev 64108)
+++ grass/trunk/include/Make/Docs.make	2015-01-13 02:32:30 UTC (rev 64109)
@@ -62,7 +62,7 @@
 	photo.html \
 	postscript.html \
 	raster.html \
-	raster3D.html \
+	raster3d.html \
 	vector.html
 
 html_pdf = \

Modified: grass/trunk/man/Makefile
===================================================================
--- grass/trunk/man/Makefile	2015-01-12 22:53:36 UTC (rev 64108)
+++ grass/trunk/man/Makefile	2015-01-13 02:32:30 UTC (rev 64109)
@@ -17,7 +17,7 @@
 	m:misc \
 	ps:postscript \
 	r:raster \
-	r3:raster3D \
+	r3:raster3d \
 	t:temporal \
 	v:vector
 

Modified: grass/trunk/man/build_class.py
===================================================================
--- grass/trunk/man/build_class.py	2015-01-12 22:53:36 UTC (rev 64108)
+++ grass/trunk/man/build_class.py	2015-01-13 02:32:30 UTC (rev 64109)
@@ -26,8 +26,11 @@
 
 write_html_header(f, "GRASS GIS %s Reference Manual: %s" % (grass_version, modclass))
 if modclass.lower() not in ['general', 'misc', 'postscript']:
+    if modclass == 'raster3d':
+        # covert keyword to nice form
+        modclass = '3D raster'
     f.write(modclass_intro_tmpl.substitute(modclass = modclass, modclass_lower = modclass.lower()))
-f.write(modclass_tmpl.substitute(modclass = modclass.title()))
+f.write(modclass_tmpl.substitute(modclass=to_title(modclass)))
 
 #for all modules:
 for cmd in html_files(cls):

Modified: grass/trunk/man/build_full_index.py
===================================================================
--- grass/trunk/man/build_full_index.py	2015-01-12 22:53:36 UTC (rev 64108)
+++ grass/trunk/man/build_full_index.py	2015-01-13 02:32:30 UTC (rev 64109)
@@ -23,7 +23,7 @@
     'm' : 'miscellaneous',
     'ps' : 'postscript',
     'r' : 'raster',
-    'r3' : '3d raster',
+    'r3' : '3D raster',
     't' : 'temporal',
     'v' : 'vector'
 }
@@ -48,7 +48,7 @@
 
 #for all module groups:
 for cls, cls_label in classes:
-    f.write(cmd2_tmpl.substitute(cmd_label = cls_label.title(), cmd = cls))
+    f.write(cmd2_tmpl.substitute(cmd_label=to_title(cls_label), cmd=cls))
     #for all modules:  
     for cmd in html_files(cls):
 	basename = os.path.splitext(cmd)[0]

Modified: grass/trunk/man/build_html.py
===================================================================
--- grass/trunk/man/build_html.py	2015-01-12 22:53:36 UTC (rev 64108)
+++ grass/trunk/man/build_html.py	2015-01-13 02:32:30 UTC (rev 64109)
@@ -131,7 +131,7 @@
       <td width="33%" valign="top" class="box"><h3> 3D raster processing</h3>
        <ul>
         <li class="box"><a href="raster3dintro.html">Intro: 3D raster map (voxel) processing</a></li>
-        <li class="box"><a href="raster3D.html">3D raster (voxel) commands manual</a></li>
+        <li class="box"><a href="raster3d.html">3D raster (voxel) commands manual</a></li>
       </ul></td>
       <td width="33%" valign="top" class="box"><h3> Image processing</h3>
        <ul>
@@ -399,6 +399,10 @@
 
     return ""
 
+def to_title(name):
+    """Convert name of command class/family to form suitable for title"""
+    return name.capitalize()
+
 ############################################################################
 
 arch_dist_dir = os.environ['ARCH_DISTDIR']

Modified: grass/trunk/raster3d/raster3dintro.html
===================================================================
--- grass/trunk/raster3d/raster3dintro.html	2015-01-12 22:53:36 UTC (rev 64108)
+++ grass/trunk/raster3d/raster3dintro.html	2015-01-13 02:32:30 UTC (rev 64109)
@@ -1,5 +1,5 @@
 <!-- meta page description: 3D raster data in GRASS GIS -->
-<!-- meta page index: raster3D -->
+<!-- meta page index: raster3d -->
 <h3>3D raster maps in general</h3>
 
 GRASS GIS is one of the few GIS software packages with 3D raster data support.

Modified: grass/trunk/tools/mkhtml.py
===================================================================
--- grass/trunk/tools/mkhtml.py	2015-01-12 22:53:36 UTC (rev 64108)
+++ grass/trunk/tools/mkhtml.py	2015-01-13 02:32:30 UTC (rev 64109)
@@ -55,7 +55,7 @@
 
 footer_index = string.Template(\
 """<hr class="header">
-<p><a href="index.html">Main index</a> | <a href="${INDEXNAME}.html">${INDEXNAMECAP} index</a> | <a href="topics.html">Topics index</a> | <a href="keywords.html">Keywords Index</a> | <a href="full_index.html">Full index</a></p>
+<p><a href="index.html">Main index</a> | <a href="${INDEXNAME}.html">${INDEXNAMECAP} index</a> | <a href="topics.html">Topics index</a> | <a href="keywords.html">Keywords index</a> | <a href="full_index.html">Full index</a></p>
 <p>© 2003-${YEAR} <a href="http://grass.osgeo.org">GRASS Development Team</a>, GRASS GIS ${GRASS_VERSION} Reference Manual</p>
 </div>
 </body>
@@ -64,7 +64,7 @@
 
 footer_noindex = string.Template(\
 """<hr class="header">
-<p><a href="index.html">Main index</a> | <a href="topics.html">Topics index</a> | <a href="keywords.html">Keywords Index</a> | <a href="full_index.html">Full index</a></p>
+<p><a href="index.html">Main index</a> | <a href="topics.html">Topics index</a> | <a href="keywords.html">Keywords index</a> | <a href="full_index.html">Full index</a></p>
 <p>© 2003-${YEAR} <a href="http://grass.osgeo.org">GRASS Development Team</a>, GRASS GIS ${GRASS_VERSION} Reference Manual</p>
 </div>
 </body>
@@ -231,12 +231,23 @@
     'ps': 'postscript',
     'p' : 'paint',
     'r' : 'raster',
-    'r3': 'raster3D',
+    'r3': 'raster3d',
     's' : 'sites',
     't' : 'temporal',
     'v' : 'vector'
     }
 
+def to_title(name):
+    """Convert name of command class/family to form suitable for title"""
+    return name.capitalize()
+
+index_titles = {}
+for key, name in index_names.iteritems():
+    if key == 'r3':
+        index_titles[key] = '3D raster'
+    else:
+        index_titles[key] = to_title(name)
+
 # process footer
 index = re.search('(<!-- meta page index:)(.*)(-->)', src_data, re.IGNORECASE)
 if index:
@@ -248,7 +259,7 @@
 else:
     mod_class = pgm.split('.', 1)[0]
     index_name = index_names.get(mod_class, '')
-    index_name_cap = index_name.title()
+    index_name_cap = index_titles.get(mod_class, '')
 
 grass_version = os.getenv("VERSION_NUMBER", "unknown")
 year = os.getenv("VERSION_DATE")



More information about the grass-commit mailing list