Explorar o código

documentation: fixed links to scripts source code

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67565 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi %!s(int64=9) %!d(string=hai) anos
pai
achega
b084a304fb
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      tools/mkhtml.py

+ 9 - 1
tools/mkhtml.py

@@ -60,7 +60,7 @@ footer_index = string.Template(
 <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 @@ year = os.getenv("VERSION_DATE")
 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,