[GRASS-SVN] r55294 - in grass/trunk: include/Make man tools
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Mar 8 10:18:49 PST 2013
Author: martinl
Date: 2013-03-08 10:18:49 -0800 (Fri, 08 Mar 2013)
New Revision: 55294
Modified:
grass/trunk/include/Make/GuiScript.make
grass/trunk/include/Make/Html.make
grass/trunk/man/Makefile
grass/trunk/man/build_class.py
grass/trunk/man/build_html.py
grass/trunk/man/build_topics.py
grass/trunk/tools/mkhtml.py
Log:
cosmetics in building manual
Modified: grass/trunk/include/Make/GuiScript.make
===================================================================
--- grass/trunk/include/Make/GuiScript.make 2013-03-08 16:54:52 UTC (rev 55293)
+++ grass/trunk/include/Make/GuiScript.make 2013-03-08 18:18:49 UTC (rev 55294)
@@ -24,11 +24,13 @@
$(MAKE) $(GUIHTML)
$(HTMLDIR)/g.gui.%.html: g.gui.%.html g.gui.%.tmp.html | $(HTMLDIR)
- $(PYTHON) $(GISBASE)/tools/mkhtml.py g.gui.$* $(GRASS_VERSION_DATE) > $@
+ VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) \
+ $(PYTHON) $(GISBASE)/tools/mkhtml.py g.gui.$* $(GRASS_VERSION_DATE) > $@
$(HTMLDIR)/wxGUI.%.html: g.gui.%.html | $(HTMLDIR)
-rm -f g.gui.$*.tmp.html
- $(PYTHON) $(GISBASE)/tools/mkhtml.py g.gui.$* $(GRASS_VERSION_DATE) > $@
+ VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) \
+ $(PYTHON) $(GISBASE)/tools/mkhtml.py g.gui.$* $(GRASS_VERSION_DATE) > $@
g.gui.%.tmp.html: $(SCRIPTDIR)/g.gui.%
$(call htmldesc,$<,$@)
Modified: grass/trunk/include/Make/Html.make
===================================================================
--- grass/trunk/include/Make/Html.make 2013-03-08 16:54:52 UTC (rev 55293)
+++ grass/trunk/include/Make/Html.make 2013-03-08 18:18:49 UTC (rev 55294)
@@ -4,7 +4,8 @@
include $(MODULE_TOPDIR)/include/Make/HtmlRules.make
$(HTMLDIR)/%.html: %.html %.tmp.html $(HTMLSRC) $(IMGDST) | $(HTMLDIR)
- $(PYTHON) $(GISBASE)/tools/mkhtml.py $* $(GRASS_VERSION_DATE) > $@
+ VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) \
+ $(PYTHON) $(GISBASE)/tools/mkhtml.py $* > $@
$(MANDIR)/%.$(MANSECT): $(HTMLDIR)/%.html
$(HTML2MAN) $< $@
Modified: grass/trunk/man/Makefile
===================================================================
--- grass/trunk/man/Makefile 2013-03-08 16:54:52 UTC (rev 55293)
+++ grass/trunk/man/Makefile 2013-03-08 18:18:49 UTC (rev 55294)
@@ -43,11 +43,15 @@
.PHONY: manpages
define build
-GISBASE="$(RUN_GISBASE)" ARCH="$(ARCH)" ARCH_DISTDIR="$(ARCH_DISTDIR)" $(PYTHON) ./build_$(1).py $(2) $(GRASS_VERSION_DATE)
+GISBASE="$(RUN_GISBASE)" ARCH="$(ARCH)" ARCH_DISTDIR="$(ARCH_DISTDIR)" \
+ VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) \
+ $(PYTHON) ./build_$(1).py $(2)
endef
define build_topics
-GISBASE="$(RUN_GISBASE)" ARCH="$(ARCH)" ARCH_DISTDIR="$(ARCH_DISTDIR)" $(PYTHON) ./build_topics.py $(HTMLDIR) $(GRASS_VERSION_DATE)
+GISBASE="$(RUN_GISBASE)" ARCH="$(ARCH)" ARCH_DISTDIR="$(ARCH_DISTDIR)" \
+ VERSION_NUMBER=$(GRASS_VERSION_NUMBER) VERSION_DATE=$(GRASS_VERSION_DATE) \
+ $(PYTHON) ./build_topics.py $(HTMLDIR)
endef
$(HTMLDIR)/topics.html: $(ALL_HTML)
Modified: grass/trunk/man/build_class.py
===================================================================
--- grass/trunk/man/build_class.py 2013-03-08 16:54:52 UTC (rev 55293)
+++ grass/trunk/man/build_class.py 2013-03-08 18:18:49 UTC (rev 55294)
@@ -27,7 +27,7 @@
write_html_header(f, "GRASS GIS %s Reference Manual: %s" % (grass_version, modclass))
if modclass.lower() not in ['general', 'misc', 'postscript']:
f.write(modclass_intro_tmpl.substitute(modclass = modclass, modclass_lower = modclass.lower()))
-f.write(modclass_tmpl.substitute(modclass = modclass))
+f.write(modclass_tmpl.substitute(modclass = modclass.title()))
#for all modules:
for cmd in html_files(cls):
Modified: grass/trunk/man/build_html.py
===================================================================
--- grass/trunk/man/build_html.py 2013-03-08 16:54:52 UTC (rev 55293)
+++ grass/trunk/man/build_html.py 2013-03-08 18:18:49 UTC (rev 55294)
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# utilities for generating HTML indices
-# (c) 2003-2006, 2009-2012 by the GRASS Development Team, Markus Neteler, Glynn Clements, Luca Delucchi
+# (c) 2003-2006, 2009-2013 by the GRASS Development Team, Markus Neteler, Glynn Clements, Luca Delucchi
import sys
import os
@@ -161,10 +161,9 @@
#"
footer_tmpl = string.Template(\
-r"""<br><br>
-<hr>
-<p><a href="${index_url}">Help Index</a> | <a href="topics.html">Topics Index</a> | <a href="full_index.html">Full Index</a><br>
-© 2003-${year} <a href="http://grass.osgeo.org">GRASS Development Team</a>, GRASS GIS ${grass_version} Reference Manual</p>
+r"""<hr>
+<p><a href="${index_url}">Help Index</a> | <a href="topics.html">Topics Index</a> | <a href="full_index.html">Full Index</a></p>
+<p>© 2003-${year} <a href="http://grass.osgeo.org">GRASS Development Team</a>, GRASS GIS ${grass_version} Reference Manual</p>
</body>
</html>
""")
@@ -176,7 +175,7 @@
cmd2_tmpl = string.Template(\
r"""<a name="${cmd}"></a>
-<br><br><h3>${cmd}.* commands:</h3>
+<h3>${cmd}.* commands:</h3>
<table>
""")
#"
@@ -188,8 +187,6 @@
sections = \
r""" ]
-<br><br>
-
<table border=0>
<tr><td> <a href="full_index.html#d">d.*</a> </td><td>display commands</td></tr>
<tr><td> <a href="full_index.html#db">db.*</a> </td><td>database commands</td></tr>
@@ -215,8 +212,8 @@
#"
modclass_tmpl = string.Template(\
-r"""Go <a href="index.html">back to help overview</a><br><br><br>
-<b>${modclass} commands:</b>
+r"""Go <a href="index.html">back to help overview</a>
+<h3>${modclass} commands:</h3>
<table>
""")
#"
@@ -228,8 +225,8 @@
full_index_header = \
-r"""Go <a href="index.html">back to help overview</a><br>
-<br><h3>Full command index:</h3>
+r"""Go <a href="index.html">back to help overview</a>
+<h3>Full command index:</h3>
[
"""
#"
@@ -368,13 +365,11 @@
arch_dist_dir = os.environ['ARCH_DISTDIR']
html_dir = os.path.join(arch_dist_dir, "docs", "html")
gisbase = os.environ['GISBASE']
-ver = read_file(os.path.join(gisbase, "etc", "VERSIONNUMBER"))
-try:
- grass_version = ver.split()[0].strip()
-except IndexError:
- grass_version = ver.split().strip()
-grass_mmver = '.'.join(ver.split('.')[0:2])
+grass_version = os.getenv("VERSION_NUMBER", "unknown")
+grass_mmver = '.'.join(grass_version.split('.')[0:2])
macosx = "darwin" in os.environ['ARCH'].lower()
-default_year = "0000" # str(datetime.now().year)
+default_year = os.getenv("VERSION_DATE")
+if not default_year:
+ default_year = str(datetime.now().year)
############################################################################
Modified: grass/trunk/man/build_topics.py
===================================================================
--- grass/trunk/man/build_topics.py 2013-03-08 16:54:52 UTC (rev 55293)
+++ grass/trunk/man/build_topics.py 2013-03-08 18:18:49 UTC (rev 55294)
@@ -11,9 +11,7 @@
from build_html import *
path = sys.argv[1]
-year = None
-if len(sys.argv) > 2:
- year = sys.argv[2]
+year = os.getenv("VERSION_DATE")
keywords = {}
Modified: grass/trunk/tools/mkhtml.py
===================================================================
--- grass/trunk/tools/mkhtml.py 2013-03-08 16:54:52 UTC (rev 55293)
+++ grass/trunk/tools/mkhtml.py 2013-03-08 18:18:49 UTC (rev 55294)
@@ -23,10 +23,6 @@
from datetime import datetime
pgm = sys.argv[1]
-if len(sys.argv) > 1:
- year = sys.argv[2]
-else:
- year = str(datetime.now().year)
src_file = "%s.html" % pgm
tmp_file = "%s.tmp.html" % pgm
@@ -52,7 +48,7 @@
footer_index = string.Template(\
"""<hr>
<p><a href="index.html">Main index</a> - <a href="${INDEXNAME}.html">${INDEXNAMECAP} index</a> - <a href="topics.html">Topics index</a> - <a href="full_index.html">Full index</a></p>
-<p>© 2003-${YEAR} <a href="http://grass.osgeo.org">GRASS Development Team</a></p>
+<p>© 2003-${YEAR} <a href="http://grass.osgeo.org">GRASS Development Team</a>, GRASS GIS ${GRASS_VERSION} Reference Manual</p>
</body>
</html>
""")
@@ -60,7 +56,7 @@
footer_noindex = string.Template(\
"""<hr>
<p><a href="index.html">Main index</a> - <a href="topics.html">Topics index</a> - <a href="full_index.html">Full index</a></p>
-<p>© 2003-${YEAR} <a href="http://grass.osgeo.org">GRASS Development Team</a></p>
+<p>© 2003-${YEAR} <a href="http://grass.osgeo.org">GRASS Development Team</a>, GRASS GIS ${GRASS_VERSION} Reference Manual</p>
</body>
</html>
""")
@@ -75,7 +71,6 @@
return ""
src_data = read_file(src_file)
-
name = re.search('(<!-- meta page name:)(.*)(-->)', src_data, re.IGNORECASE)
if name:
pgm = name.group(2).strip().split('-', 1)[0].strip()
@@ -125,8 +120,13 @@
index_name = index_names.get(mod_class, '')
index_name_cap = index_name.title()
+grass_version = os.getenv("VERSION_NUMBER", "unknown")
+year = os.getenv("VERSION_DATE")
+if not year:
+ year = str(datetime.now().year)
+
if index_name:
sys.stdout.write(footer_index.substitute(INDEXNAME = index_name, INDEXNAMECAP = index_name_cap,
- YEAR = year))
+ YEAR = year, GRASS_VERSION = grass_version))
else:
- sys.stdout.write(footer_noindex.substitute(YEAR = year))
+ sys.stdout.write(footer_noindex.substitute(YEAR = year, GRASS_VERSION = grass_version))
More information about the grass-commit
mailing list