[GRASS-SVN] r66109 - grass/branches/releasebranch_7_0/man

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 5 02:00:50 PDT 2015


Author: neteler
Date: 2015-09-05 02:00:50 -0700 (Sat, 05 Sep 2015)
New Revision: 66109

Modified:
   grass/branches/releasebranch_7_0/man/Makefile
   grass/branches/releasebranch_7_0/man/build_topics.py
Log:
docs: do not add topics with less than 3 modules to the topics index in order to not clutter it (trunk, r66040)

Modified: grass/branches/releasebranch_7_0/man/Makefile
===================================================================
--- grass/branches/releasebranch_7_0/man/Makefile	2015-09-05 07:47:34 UTC (rev 66108)
+++ grass/branches/releasebranch_7_0/man/Makefile	2015-09-05 09:00:50 UTC (rev 66109)
@@ -67,7 +67,7 @@
 	$(PYTHON) ./build_keywords.py $(HTMLDIR)
 endef
 
-$(HTMLDIR)/topics.html: $(ALL_HTML)
+$(HTMLDIR)/topics.html: $(ALL_HTML) build_topics.py
 	$(call build_topics)
 	touch $@
 

Modified: grass/branches/releasebranch_7_0/man/build_topics.py
===================================================================
--- grass/branches/releasebranch_7_0/man/build_topics.py	2015-09-05 07:47:34 UTC (rev 66108)
+++ grass/branches/releasebranch_7_0/man/build_topics.py	2015-09-05 09:00:50 UTC (rev 66109)
@@ -12,6 +12,8 @@
 path = sys.argv[1]
 year = os.getenv("VERSION_DATE")
 
+min_num_modules_for_topic = 3
+
 keywords = {}
 
 htmlfiles = glob.glob1(path, '*.html')
@@ -46,16 +48,19 @@
 topicsfile.write(headertopics_tmpl)
 
 for key, values in sorted(keywords.iteritems()):
-    topicsfile.writelines([moduletopics_tmpl.substitute(key=key.lower(),
-                                                        name=key.replace('_', ' '))])
     keyfile = open(os.path.join(path, 'topic_%s.html' % key.lower()), 'w')
     keyfile.write(header1_tmpl.substitute(title = "GRASS GIS " \
                         "%s Reference Manual: Topic %s" % (grass_version,
                                                     key.replace('_', ' '))))
     keyfile.write(headerkey_tmpl.substitute(keyword=key.replace('_', ' ')))
+    num_modules = 0
     for mod, desc in sorted(values.iteritems()):
+        num_modules += 1
         keyfile.write(desc1_tmpl.substitute(cmd=mod, desc=desc,
                                             basename=mod.replace('.html', '')))
+    if num_modules >= min_num_modules_for_topic:
+        topicsfile.writelines([moduletopics_tmpl.substitute(
+            key=key.lower(), name=key.replace('_', ' '))])
     keyfile.write("</table>\n")
     write_html_footer(keyfile, "index.html", year)
 topicsfile.write("</ul>\n")



More information about the grass-commit mailing list