Forráskód Böngészése

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 https://trac.osgeo.org/grass/ticket/2409 and https://trac.osgeo.org/grass/changeset/64055


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64109 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 10 éve
szülő
commit
5c78340579

+ 1 - 1
include/Make/Docs.make

@@ -62,7 +62,7 @@ indices = \
 	photo.html \
 	postscript.html \
 	raster.html \
-	raster3D.html \
+	raster3d.html \
 	vector.html
 
 html_pdf = \

+ 1 - 1
man/Makefile

@@ -17,7 +17,7 @@ categories = \
 	m:misc \
 	ps:postscript \
 	r:raster \
-	r3:raster3D \
+	r3:raster3d \
 	t:temporal \
 	v:vector
 

+ 4 - 1
man/build_class.py

@@ -26,8 +26,11 @@ f = open(filename + ".tmp", 'wb')
 
 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):

+ 2 - 2
man/build_full_index.py

@@ -23,7 +23,7 @@ class_labels = {
     'm' : 'miscellaneous',
     'ps' : 'postscript',
     'r' : 'raster',
-    'r3' : '3d raster',
+    'r3' : '3D raster',
     't' : 'temporal',
     'v' : 'vector'
 }
@@ -48,7 +48,7 @@ f.write(toc)
 
 #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]

+ 5 - 1
man/build_html.py

@@ -131,7 +131,7 @@ r"""<!-- the files grass${grass_version_major}.html & helptext.html file live in
       <td width="33%" valign="top" class="box"><h3>&nbsp;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>&nbsp;Image processing</h3>
        <ul>
@@ -399,6 +399,10 @@ def get_desc(cmd):
 
     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']

+ 1 - 1
raster3d/raster3dintro.html

@@ -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.

+ 15 - 4
tools/mkhtml.py

@@ -55,7 +55,7 @@ header_pgm_desc = """<h2>NAME</h2>
 
 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>&copy; 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_index = string.Template(\
 
 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>&copy; 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 @@ index_names = {
     '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 @@ if index:
 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")