[GRASS-SVN] r67565 - grass/trunk/tools

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 12 08:16:50 PST 2016


Author: lucadelu
Date: 2016-01-12 08:16:49 -0800 (Tue, 12 Jan 2016)
New Revision: 67565

Modified:
   grass/trunk/tools/mkhtml.py
Log:
documentation: fixed links to scripts source code

Modified: grass/trunk/tools/mkhtml.py
===================================================================
--- grass/trunk/tools/mkhtml.py	2016-01-12 15:30:58 UTC (rev 67564)
+++ grass/trunk/tools/mkhtml.py	2016-01-12 16:16:49 UTC (rev 67565)
@@ -60,7 +60,7 @@
 <p>
 <a href="index.html">Main index</a> |
 <a href="${INDEXNAME}.html">${INDEXNAMECAP} index</a> |
-<a href="${URL}/${INDEXNAME}/${PGM}">Source code</a> |
+<a href="${URL}/${FOLDER}/${PGM}">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> |
@@ -292,10 +292,18 @@
 if not year:
     year = str(datetime.now().year)
 
+# check the names of scripts to assign the right folder
+topdir = os.getenv("MODULE_TOPDIR")
+scripts = os.listdir(os.path.join(topdir, 'scripts'))
+if pgm in scripts:
+    folder = 'scripts'
+else:
+    folder = index_name
 if index_name:
     sys.stdout.write(footer_index.substitute(INDEXNAME=index_name, PGM=pgm,
                                              INDEXNAMECAP=index_name_cap,
                                              YEAR=year, URL=source_url,
+                                             FOLDER=folder,
                                              GRASS_VERSION=grass_version))
 else:
     sys.stdout.write(footer_noindex.substitute(YEAR=year,



More information about the grass-commit mailing list