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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 10 20:02:53 PST 2017


Author: hcho
Date: 2017-03-10 20:02:53 -0800 (Fri, 10 Mar 2017)
New Revision: 70737

Modified:
   grass/trunk/tools/mkhtml.py
Log:
mkhtml.py: Fix broken links for addon manuals when compiling without SOURCE_URL (Fix #3224)

Modified: grass/trunk/tools/mkhtml.py
===================================================================
--- grass/trunk/tools/mkhtml.py	2017-03-10 09:27:49 UTC (rev 70736)
+++ grass/trunk/tools/mkhtml.py	2017-03-11 04:02:53 UTC (rev 70737)
@@ -39,7 +39,8 @@
 src_file = "%s.html" % pgm
 tmp_file = "%s.tmp.html" % pgm
 
-source_url = "https://trac.osgeo.org/grass/browser/grass/trunk/"
+trunk_url = "https://trac.osgeo.org/grass/browser/grass/trunk/"
+addons_url = "https://trac.osgeo.org/grass/browser/grass-addons/"
 
 header_base = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
@@ -314,7 +315,13 @@
 # check the names of scripts to assign the right folder
 topdir = os.path.abspath(os.getenv("MODULE_TOPDIR"))
 curdir = os.path.abspath(os.path.curdir)
-pgmdir = curdir.replace(topdir, '').lstrip(os.path.sep)
+if curdir.startswith(topdir):
+    source_url = trunk_url
+    pgmdir = curdir.replace(topdir, '').lstrip(os.path.sep)
+else:
+    # addons
+    source_url = addons_url
+    pgmdir = os.path.sep.join(curdir.split(os.path.sep)[-3:])
 url_source = ''
 if os.getenv('SOURCE_URL', ''):
     # addons



More information about the grass-commit mailing list