[GRASS-SVN] r59843 - grass/branches/releasebranch_7_0/tools

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Apr 20 10:56:41 PDT 2014


Author: martinl
Date: 2014-04-20 10:56:41 -0700 (Sun, 20 Apr 2014)
New Revision: 59843

Modified:
   grass/branches/releasebranch_7_0/tools/mkhtml.py
Log:
mkhtml: support labels in page index + fix   tag, change _ to - in href names
        (merge r59832, r59834 from trunk)


Modified: grass/branches/releasebranch_7_0/tools/mkhtml.py
===================================================================
--- grass/branches/releasebranch_7_0/tools/mkhtml.py	2014-04-20 17:54:31 UTC (rev 59842)
+++ grass/branches/releasebranch_7_0/tools/mkhtml.py	2014-04-20 17:56:41 UTC (rev 59843)
@@ -120,8 +120,10 @@
 def escape_href(label):
     # remove html tags
     label = re.sub('<[^<]+?>', '', label)
+    # fix  
+    label = label.replace(' ', '')
     # replace space with underscore + lower
-    return label.replace(' ', '_').lower()
+    return label.replace(' ', '-').lower()
 
 def write_toc(data):
     if not data:
@@ -220,7 +222,11 @@
 # process footer
 index = re.search('(<!-- meta page index:)(.*)(-->)', src_data, re.IGNORECASE)
 if index:
-    index_name_cap = index_name = index.group(2).strip()
+    index_name = index.group(2).strip()
+    if '|' in index_name:
+        index_name, index_name_cap = index_name.split('|', 1)
+    else:
+        index_name_cap = index_name
 else:
     mod_class = pgm.split('.', 1)[0]
     index_name = index_names.get(mod_class, '')



More information about the grass-commit mailing list