[GRASS-SVN] r66040 - grass/trunk/man
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Aug 26 18:51:27 PDT 2015
Author: wenzeslaus
Date: 2015-08-26 18:51:27 -0700 (Wed, 26 Aug 2015)
New Revision: 66040
Modified:
grass/trunk/man/Makefile
grass/trunk/man/build_topics.py
Log:
docs: do not add small topics to index
Topics with less than 3 modules in them are not included in Topics index. This makes the index shorter and easier to navigate. Topics are still included in keyword index as keywords, so there is no need to list them when they are not so important (assuming importance/impact equals module count).
The topic pages are still generated, so there is no need to change anything for the modules. By clicking at the second keyword users still gets to the topic page. It is just not advertised in the Topics index.
Modified: grass/trunk/man/Makefile
===================================================================
--- grass/trunk/man/Makefile 2015-08-27 01:32:30 UTC (rev 66039)
+++ grass/trunk/man/Makefile 2015-08-27 01:51:27 UTC (rev 66040)
@@ -79,7 +79,7 @@
$(PYTHON) ./build_class_graphical.py $(HTMLDIR)
endef
-$(HTMLDIR)/topics.html: $(ALL_HTML)
+$(HTMLDIR)/topics.html: $(ALL_HTML) build_topics.py
$(call build_topics)
touch $@
Modified: grass/trunk/man/build_topics.py
===================================================================
--- grass/trunk/man/build_topics.py 2015-08-27 01:32:30 UTC (rev 66039)
+++ grass/trunk/man/build_topics.py 2015-08-27 01:51:27 UTC (rev 66040)
@@ -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