[GRASS-SVN] r69587 - grass/trunk/tools

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 27 11:55:58 PDT 2016


Author: wenzeslaus
Date: 2016-09-27 11:55:58 -0700 (Tue, 27 Sep 2016)
New Revision: 69587

Modified:
   grass/trunk/tools/mkhtml.py
Log:
doc: move 3D raster special case to a function and use it also for pages with meta (fixes text for index links for intro pages)

Modified: grass/trunk/tools/mkhtml.py
===================================================================
--- grass/trunk/tools/mkhtml.py	2016-09-27 18:53:19 UTC (rev 69586)
+++ grass/trunk/tools/mkhtml.py	2016-09-27 18:55:58 UTC (rev 69587)
@@ -269,16 +269,18 @@
     }
 
 
+# TODO: special code for ps/postscript/PostScirpt and m/misc/Miscellaneous
 def to_title(name):
     """Convert name of command class/family to form suitable for title"""
-    return name.capitalize()
+    if name == 'raster3d':
+        return '3D raster'
+    else:
+        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)
+    index_titles[key] = to_title(name)
 
 # process footer
 index = re.search('(<!-- meta page index:)(.*)(-->)', src_data, re.IGNORECASE)
@@ -287,7 +289,7 @@
     if '|' in index_name:
         index_name, index_name_cap = index_name.split('|', 1)
     else:
-        index_name_cap = index_name
+        index_name_cap = to_title(index_name)
 else:
     mod_class = pgm.split('.', 1)[0]
     index_name = index_names.get(mod_class, '')



More information about the grass-commit mailing list