[GRASS-SVN] r69290 - grass/branches/releasebranch_7_2/tools

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 27 15:43:12 PDT 2016


Author: lucadelu
Date: 2016-08-27 15:43:11 -0700 (Sat, 27 Aug 2016)
New Revision: 69290

Modified:
   grass/branches/releasebranch_7_2/tools/mkhtml.py
Log:
documentation: moved source code link and add revision log link, backport r69283 r69289, fixed #2864

Modified: grass/branches/releasebranch_7_2/tools/mkhtml.py
===================================================================
--- grass/branches/releasebranch_7_2/tools/mkhtml.py	2016-08-27 22:28:58 UTC (rev 69289)
+++ grass/branches/releasebranch_7_2/tools/mkhtml.py	2016-08-27 22:43:11 UTC (rev 69290)
@@ -56,12 +56,17 @@
 <em><b>${PGM}</b></em> - ${PGM_DESC}
 """
 
+sourcecode = string.Template(
+"""<h2>SOURCE CODE</h2>
+<p>Available at: <a href="${URL_SOURCE}">${PGM} source code</a> (<a href="${URL_LOG}">history</a>)</p>
+"""
+)
+
 footer_index = string.Template(
 """<hr class="header">
 <p>
 <a href="index.html">Main index</a> |
 <a href="${INDEXNAME}.html">${INDEXNAMECAP} index</a> |
-<a href="${URL}">Source code</a> |
 <a href="topics.html">Topics index</a> |
 <a href="keywords.html">Keywords index</a> |
 <a href="graphical_index.html">Graphical index</a> |
@@ -297,13 +302,14 @@
 topdir = os.path.abspath(os.getenv("MODULE_TOPDIR"))
 curdir = os.path.abspath(os.path.curdir)
 pgmdir = curdir.replace(topdir, '').lstrip('/')
-url = urlparse.urljoin(source_url, pgmdir)
+url_source = urlparse.urljoin(source_url, pgmdir)
 
 if index_name:
+    sys.stdout.write(sourcecode.substitute(URL_SOURCE=url_source, PGM=pgm,
+                                           URL_LOG=url_source.replace('browser',  'log')))
     sys.stdout.write(footer_index.substitute(INDEXNAME=index_name,
                                              INDEXNAMECAP=index_name_cap,
-                                             YEAR=year, URL=url,
-                                             GRASS_VERSION=grass_version))
+                                             YEAR=year, GRASS_VERSION=grass_version))
 else:
     sys.stdout.write(footer_noindex.substitute(YEAR=year,
                                                GRASS_VERSION=grass_version))



More information about the grass-commit mailing list