mkhtml.py 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. #!/usr/bin/env python3
  2. ############################################################################
  3. #
  4. # MODULE: Builds manual pages
  5. # AUTHOR(S): Markus Neteler
  6. # Glynn Clements
  7. # Martin Landa <landa.martin gmail.com>
  8. # PURPOSE: Create HTML manual page snippets
  9. # COPYRIGHT: (C) 2007-2022 by Glynn Clements
  10. # and the GRASS Development Team
  11. #
  12. # This program is free software under the GNU General
  13. # Public License (>=v2). Read the file COPYING that
  14. # comes with GRASS for details.
  15. #
  16. #############################################################################
  17. import http
  18. import sys
  19. import os
  20. import string
  21. import re
  22. from datetime import datetime
  23. import locale
  24. import json
  25. import pathlib
  26. import shutil
  27. import subprocess
  28. import time
  29. try:
  30. # Python 2 import
  31. from HTMLParser import HTMLParser
  32. except ImportError:
  33. # Python 3 import
  34. from html.parser import HTMLParser
  35. from six.moves.urllib import request as urlrequest
  36. from six.moves.urllib.error import HTTPError, URLError
  37. try:
  38. import urlparse
  39. except ImportError:
  40. import urllib.parse as urlparse
  41. try:
  42. import grass.script as gs
  43. except ImportError:
  44. # During compilation GRASS GIS
  45. _ = str
  46. class gs:
  47. def warning(message):
  48. pass
  49. def fatal(message):
  50. pass
  51. HEADERS = {
  52. "User-Agent": "Mozilla/5.0",
  53. }
  54. HTTP_STATUS_CODES = list(http.HTTPStatus)
  55. if sys.version_info[0] == 2:
  56. PY2 = True
  57. else:
  58. PY2 = False
  59. if not PY2:
  60. unicode = str
  61. grass_version = os.getenv("VERSION_NUMBER", "unknown")
  62. trunk_url = ""
  63. addons_url = ""
  64. grass_git_branch = "main"
  65. if grass_version != "unknown":
  66. major, minor, patch = grass_version.split(".")
  67. base_url = "https://github.com/OSGeo"
  68. trunk_url = "{base_url}/grass/tree/{branch}/".format(
  69. base_url=base_url, branch=grass_git_branch
  70. )
  71. addons_url = "{base_url}/grass-addons/tree/grass{major}/".format(
  72. base_url=base_url, major=major
  73. )
  74. def _get_encoding():
  75. encoding = locale.getdefaultlocale()[1]
  76. if not encoding:
  77. encoding = "UTF-8"
  78. return encoding
  79. def decode(bytes_):
  80. """Decode bytes with default locale and return (unicode) string
  81. No-op if parameter is not bytes (assumed unicode string).
  82. :param bytes bytes_: the bytes to decode
  83. """
  84. if isinstance(bytes_, unicode):
  85. return bytes_
  86. if isinstance(bytes_, bytes):
  87. enc = _get_encoding()
  88. return bytes_.decode(enc)
  89. return unicode(bytes_)
  90. def urlopen(url, *args, **kwargs):
  91. """Wrapper around urlopen. Same function as 'urlopen', but with the
  92. ability to define headers.
  93. """
  94. request = urlrequest.Request(url, headers=HEADERS)
  95. return urlrequest.urlopen(request, *args, **kwargs)
  96. def set_proxy():
  97. """Set proxy"""
  98. proxy = os.getenv("GRASS_PROXY")
  99. if proxy:
  100. proxies = {}
  101. for ptype, purl in (p.split("=") for p in proxy.split(",")):
  102. proxies[ptype] = purl
  103. urlrequest.install_opener(
  104. urlrequest.build_opener(urlrequest.ProxyHandler(proxies))
  105. )
  106. set_proxy()
  107. def download_git_commit(url, response_format, *args, **kwargs):
  108. """Download module/addon last commit from GitHub API
  109. :param str url: url address
  110. :param str response_format: content type
  111. :return urllib.request.urlopen or None response: response object or
  112. None
  113. """
  114. try:
  115. response = urlopen(url, *args, **kwargs)
  116. if not response.code == 200:
  117. index = HTTP_STATUS_CODES.index(response.code)
  118. desc = HTTP_STATUS_CODES[index].description
  119. gs.fatal(
  120. _(
  121. "Download commit from <{url}>, return status code "
  122. "{code}, {desc}".format(
  123. url=url,
  124. code=response.code,
  125. desc=desc,
  126. ),
  127. ),
  128. )
  129. if response_format not in response.getheader("Content-Type"):
  130. gs.fatal(
  131. _(
  132. "Wrong downloaded commit file format. "
  133. "Check url <{url}>. Allowed file format is "
  134. "{response_format}.".format(
  135. url=url,
  136. response_format=response_format,
  137. ),
  138. ),
  139. )
  140. return response
  141. except HTTPError as err:
  142. gs.warning(
  143. _(
  144. "The download of the commit from the GitHub API "
  145. "server wasn't successful, <{}>. Commit and commit "
  146. "date will not be included in the <{}> addon html manual "
  147. "page.".format(err.msg, pgm)
  148. ),
  149. )
  150. except URLError:
  151. gs.warning(
  152. _(
  153. "Download file from <{url}>, failed. Check internet "
  154. "connection. Commit and commit date will not be included "
  155. "in the <{pgm}> addon manual page.".format(url=url, pgm=pgm)
  156. ),
  157. )
  158. def get_last_git_commit(src_dir, is_addon, addon_path):
  159. """Get last module/addon git commit
  160. :param str src_dir: module/addon source dir
  161. :param bool is_addon: True if it is addon
  162. :param str addon_path: addon path
  163. :return dict git_log: dict with key commit and date, if not
  164. possible download commit from GitHub API server
  165. values of keys have "unknown" string
  166. """
  167. unknown = "unknown"
  168. git_log = {"commit": unknown, "date": unknown}
  169. datetime_format = "%A %b %d %H:%M:%S %Y" # e.g. Sun Jan 16 23:09:35 2022
  170. if is_addon:
  171. grass_addons_url = (
  172. "https://api.github.com/repos/osgeo/grass-addons/commits?path={path}"
  173. "&page=1&per_page=1&sha=grass{major}".format(
  174. path=addon_path,
  175. major=major,
  176. )
  177. ) # sha=git_branch_name
  178. else:
  179. core_module_path = os.path.join(
  180. *(set(src_dir.split(os.path.sep)) ^ set(topdir.split(os.path.sep)))
  181. )
  182. grass_modules_url = (
  183. "https://api.github.com/repos/osgeo/grass/commits?path={path}"
  184. "&page=1&per_page=1&sha={branch}".format(
  185. branch=grass_git_branch,
  186. path=core_module_path,
  187. )
  188. ) # sha=git_branch_name
  189. if shutil.which("git"):
  190. if os.path.exists(src_dir):
  191. git_log["date"] = time.ctime(os.path.getmtime(src_dir))
  192. stdout, stderr = subprocess.Popen(
  193. args=["git", "log", "-1", src_dir],
  194. stdout=subprocess.PIPE,
  195. stderr=subprocess.PIPE,
  196. ).communicate()
  197. stdout = decode(stdout)
  198. stderr = decode(stderr)
  199. if stderr and "fatal: not a git repository" in stderr:
  200. response = download_git_commit(
  201. url=grass_addons_url if is_addon else grass_modules_url,
  202. response_format="application/json",
  203. )
  204. if response:
  205. commit = json.loads(response.read())
  206. if commit:
  207. git_log["commit"] = commit[0]["sha"]
  208. git_log["date"] = datetime.strptime(
  209. commit[0]["commit"]["author"]["date"],
  210. "%Y-%m-%dT%H:%M:%SZ",
  211. ).strftime(datetime_format)
  212. else:
  213. if stdout:
  214. commit = stdout.splitlines()
  215. git_log["commit"] = commit[0].split(" ")[-1]
  216. commit_date = commit[2].lstrip("Date:").strip()
  217. git_log["date"] = commit_date.rsplit(" ", 1)[0]
  218. return git_log
  219. html_page_footer_pages_path = (
  220. os.getenv("HTML_PAGE_FOOTER_PAGES_PATH")
  221. if os.getenv("HTML_PAGE_FOOTER_PAGES_PATH")
  222. else ""
  223. )
  224. pgm = sys.argv[1]
  225. src_file = "%s.html" % pgm
  226. tmp_file = "%s.tmp.html" % pgm
  227. header_base = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  228. <html>
  229. <head>
  230. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  231. <title>${PGM} - GRASS GIS Manual</title>
  232. <meta name="Author" content="GRASS Development Team">
  233. <meta name="description" content="${PGM}: ${PGM_DESC}">
  234. <link rel="stylesheet" href="grassdocs.css" type="text/css">
  235. </head>
  236. <body bgcolor="white">
  237. <div id="container">
  238. <a href="index.html"><img src="grass_logo.png" alt="GRASS logo"></a>
  239. <hr class="header">
  240. """
  241. header_nopgm = """<h2>${PGM}</h2>
  242. """
  243. header_pgm = """<h2>NAME</h2>
  244. <em><b>${PGM}</b></em>
  245. """
  246. header_pgm_desc = """<h2>NAME</h2>
  247. <em><b>${PGM}</b></em> - ${PGM_DESC}
  248. """
  249. sourcecode = string.Template(
  250. """<h2>SOURCE CODE</h2>
  251. <p>
  252. Available at:
  253. <a href="${URL_SOURCE}">${PGM} source code</a>
  254. (<a href="${URL_LOG}">history</a>)
  255. </p>
  256. <p>
  257. ${DATE_TAG}
  258. </p>
  259. """
  260. )
  261. footer_index = string.Template(
  262. """<hr class="header">
  263. <p>
  264. <a href="index.html">Main index</a> |
  265. <a href="${HTML_PAGE_FOOTER_PAGES_PATH}${INDEXNAME}.html">${INDEXNAMECAP} index</a> |
  266. <a href="${HTML_PAGE_FOOTER_PAGES_PATH}topics.html">Topics index</a> |
  267. <a href="${HTML_PAGE_FOOTER_PAGES_PATH}keywords.html">Keywords index</a> |
  268. <a href="${HTML_PAGE_FOOTER_PAGES_PATH}graphical_index.html">Graphical index</a> |
  269. <a href="${HTML_PAGE_FOOTER_PAGES_PATH}full_index.html">Full index</a>
  270. </p>
  271. <p>
  272. &copy; 2003-${YEAR}
  273. <a href="https://grass.osgeo.org">GRASS Development Team</a>,
  274. GRASS GIS ${GRASS_VERSION} Reference Manual
  275. </p>
  276. </div>
  277. </body>
  278. </html>
  279. """
  280. )
  281. footer_noindex = string.Template(
  282. """<hr class="header">
  283. <p>
  284. <a href="index.html">Main index</a> |
  285. <a href="${HTML_PAGE_FOOTER_PAGES_PATH}topics.html">Topics index</a> |
  286. <a href="${HTML_PAGE_FOOTER_PAGES_PATH}keywords.html">Keywords index</a> |
  287. <a href="${HTML_PAGE_FOOTER_PAGES_PATH}graphical_index.html">Graphical index</a> |
  288. <a href="${HTML_PAGE_FOOTER_PAGES_PATH}full_index.html">Full index</a>
  289. </p>
  290. <p>
  291. &copy; 2003-${YEAR}
  292. <a href="https://grass.osgeo.org">GRASS Development Team</a>,
  293. GRASS GIS ${GRASS_VERSION} Reference Manual
  294. </p>
  295. </div>
  296. </body>
  297. </html>
  298. """
  299. )
  300. def read_file(name):
  301. try:
  302. f = open(name, "rb")
  303. s = f.read()
  304. f.close()
  305. if PY2:
  306. return s
  307. else:
  308. return decode(s)
  309. except IOError:
  310. return ""
  311. def create_toc(src_data):
  312. class MyHTMLParser(HTMLParser):
  313. def __init__(self):
  314. HTMLParser.__init__(self)
  315. self.reset()
  316. self.idx = 1
  317. self.tag_curr = ""
  318. self.tag_last = ""
  319. self.process_text = False
  320. self.data = []
  321. self.tags_allowed = ("h1", "h2", "h3")
  322. self.tags_ignored = "img"
  323. self.text = ""
  324. def handle_starttag(self, tag, attrs):
  325. if tag in self.tags_allowed:
  326. self.process_text = True
  327. self.tag_last = self.tag_curr
  328. self.tag_curr = tag
  329. def handle_endtag(self, tag):
  330. if tag in self.tags_allowed:
  331. self.data.append((tag, "%s_%d" % (tag, self.idx), self.text))
  332. self.idx += 1
  333. self.process_text = False
  334. self.text = ""
  335. self.tag_curr = self.tag_last
  336. def handle_data(self, data):
  337. if not self.process_text:
  338. return
  339. if self.tag_curr in self.tags_allowed or self.tag_curr in self.tags_ignored:
  340. self.text += data
  341. else:
  342. self.text += "<%s>%s</%s>" % (self.tag_curr, data, self.tag_curr)
  343. # instantiate the parser and fed it some HTML
  344. parser = MyHTMLParser()
  345. parser.feed(src_data)
  346. return parser.data
  347. def escape_href(label):
  348. # remove html tags
  349. label = re.sub("<[^<]+?>", "", label)
  350. # fix &nbsp;
  351. label = label.replace("&nbsp;", "")
  352. # fix "
  353. label = label.replace('"', "")
  354. # replace space with underscore + lower
  355. return label.replace(" ", "-").lower()
  356. def write_toc(data):
  357. if not data:
  358. return
  359. fd = sys.stdout
  360. fd.write('<div class="toc">\n')
  361. fd.write('<h4 class="toc">Table of contents</h4>\n')
  362. fd.write('<ul class="toc">\n')
  363. first = True
  364. has_h2 = False
  365. in_h3 = False
  366. indent = 4
  367. for tag, href, text in data:
  368. if tag == "h3" and not in_h3 and has_h2:
  369. fd.write('\n%s<ul class="toc">\n' % (" " * indent))
  370. indent += 4
  371. in_h3 = True
  372. elif not first:
  373. fd.write("</li>\n")
  374. if tag == "h2":
  375. has_h2 = True
  376. if in_h3:
  377. indent -= 4
  378. fd.write("%s</ul></li>\n" % (" " * indent))
  379. in_h3 = False
  380. text = text.replace("\xa0", " ")
  381. fd.write(
  382. '%s<li class="toc"><a href="#%s" class="toc">%s</a>'
  383. % (" " * indent, escape_href(text), text)
  384. )
  385. first = False
  386. fd.write("</li>\n</ul>\n")
  387. fd.write("</div>\n")
  388. def update_toc(data):
  389. ret_data = []
  390. pat = re.compile(r"(<(h[2|3])>)(.+)(</h[2|3]>)")
  391. idx = 1
  392. for line in data.splitlines():
  393. if pat.search(line):
  394. xline = pat.split(line)
  395. line = (
  396. xline[1]
  397. + '<a name="%s">' % escape_href(xline[3])
  398. + xline[3]
  399. + "</a>"
  400. + xline[4]
  401. )
  402. idx += 1
  403. ret_data.append(line)
  404. return "\n".join(ret_data)
  405. def get_addon_path():
  406. """Check if pgm is in the addons list and get addon path
  407. return: pgm path if pgm is addon else None
  408. """
  409. addon_base = os.getenv("GRASS_ADDON_BASE")
  410. if addon_base:
  411. # addons_paths.json is file created during install extension
  412. # check get_addons_paths() function in the g.extension.py file
  413. addons_file = "addons_paths.json"
  414. addons_paths = os.path.join(addon_base, addons_file)
  415. if not os.path.exists(addons_paths):
  416. # Compiled addon has own dir e.g. ~/.grass8/addons/db.join/
  417. # with bin/ docs/ etc/ scripts/ subdir, required for compilation
  418. # addons on osgeo lxd container server and generation of
  419. # modules.xml file (build-xml.py script), when addons_paths.json
  420. # file is stored one level dir up
  421. addons_paths = os.path.join(
  422. os.path.abspath(os.path.join(addon_base, "..")),
  423. addons_file,
  424. )
  425. if not os.path.exists(addons_paths):
  426. return
  427. with open(addons_paths) as f:
  428. addons_paths = json.load(f)
  429. for addon in addons_paths["tree"]:
  430. if pgm == pathlib.Path(addon["path"]).name:
  431. return addon["path"]
  432. # process header
  433. src_data = read_file(src_file)
  434. name = re.search("(<!-- meta page name:)(.*)(-->)", src_data, re.IGNORECASE)
  435. pgm_desc = "GRASS GIS Reference Manual"
  436. if name:
  437. pgm = name.group(2).strip().split("-", 1)[0].strip()
  438. name_desc = re.search(
  439. "(<!-- meta page name description:)(.*)(-->)", src_data, re.IGNORECASE
  440. )
  441. if name_desc:
  442. pgm_desc = name_desc.group(2).strip()
  443. desc = re.search("(<!-- meta page description:)(.*)(-->)", src_data, re.IGNORECASE)
  444. if desc:
  445. pgm = desc.group(2).strip()
  446. header_tmpl = string.Template(header_base + header_nopgm)
  447. else:
  448. if not pgm_desc:
  449. header_tmpl = string.Template(header_base + header_pgm)
  450. else:
  451. header_tmpl = string.Template(header_base + header_pgm_desc)
  452. if not re.search("<html>", src_data, re.IGNORECASE):
  453. tmp_data = read_file(tmp_file)
  454. """
  455. Adjusting keywords html pages paths if add-on html man page
  456. stored on the server
  457. """
  458. if html_page_footer_pages_path:
  459. new_keywords_paths = []
  460. orig_keywords_paths = re.search(
  461. r"<h[1-9]>KEYWORDS</h[1-9]>(.*?)<h[1-9]>",
  462. tmp_data,
  463. re.DOTALL,
  464. )
  465. if orig_keywords_paths:
  466. search_txt = 'href="'
  467. for i in orig_keywords_paths.group(1).split(","):
  468. if search_txt in i:
  469. index = i.index(search_txt) + len(search_txt)
  470. new_keywords_paths.append(
  471. i[:index] + html_page_footer_pages_path + i[index:],
  472. )
  473. if new_keywords_paths:
  474. tmp_data = tmp_data.replace(
  475. orig_keywords_paths.group(1),
  476. ",".join(new_keywords_paths),
  477. )
  478. if not re.search("<html>", tmp_data, re.IGNORECASE):
  479. sys.stdout.write(header_tmpl.substitute(PGM=pgm, PGM_DESC=pgm_desc))
  480. if tmp_data:
  481. for line in tmp_data.splitlines(True):
  482. if not re.search("</body>|</html>", line, re.IGNORECASE):
  483. sys.stdout.write(line)
  484. # create TOC
  485. write_toc(create_toc(src_data))
  486. # process body
  487. sys.stdout.write(update_toc(src_data))
  488. # if </html> is found, suppose a complete html is provided.
  489. # otherwise, generate module class reference:
  490. if re.search("</html>", src_data, re.IGNORECASE):
  491. sys.exit()
  492. index_names = {
  493. "d": "display",
  494. "db": "database",
  495. "g": "general",
  496. "i": "imagery",
  497. "m": "miscellaneous",
  498. "ps": "postscript",
  499. "p": "paint",
  500. "r": "raster",
  501. "r3": "raster3d",
  502. "s": "sites",
  503. "t": "temporal",
  504. "v": "vector",
  505. }
  506. def to_title(name):
  507. """Convert name of command class/family to form suitable for title"""
  508. if name == "raster3d":
  509. return "3D raster"
  510. elif name == "postscript":
  511. return "PostScript"
  512. else:
  513. return name.capitalize()
  514. index_titles = {}
  515. for key, name in index_names.items():
  516. index_titles[key] = to_title(name)
  517. # process footer
  518. index = re.search("(<!-- meta page index:)(.*)(-->)", src_data, re.IGNORECASE)
  519. if index:
  520. index_name = index.group(2).strip()
  521. if "|" in index_name:
  522. index_name, index_name_cap = index_name.split("|", 1)
  523. else:
  524. index_name_cap = to_title(index_name)
  525. else:
  526. mod_class = pgm.split(".", 1)[0]
  527. index_name = index_names.get(mod_class, "")
  528. index_name_cap = index_titles.get(mod_class, "")
  529. year = os.getenv("VERSION_DATE")
  530. if not year:
  531. year = str(datetime.now().year)
  532. # check the names of scripts to assign the right folder
  533. topdir = os.path.abspath(os.getenv("MODULE_TOPDIR"))
  534. curdir = os.path.abspath(os.path.curdir)
  535. if curdir.startswith(topdir + os.path.sep):
  536. source_url = trunk_url
  537. pgmdir = curdir.replace(topdir, "").lstrip(os.path.sep)
  538. else:
  539. # addons
  540. source_url = addons_url
  541. pgmdir = os.path.sep.join(curdir.split(os.path.sep)[-3:])
  542. url_source = ""
  543. addon_path = None
  544. if os.getenv("SOURCE_URL", ""):
  545. addon_path = get_addon_path()
  546. if addon_path:
  547. # Addon is installed from the local dir
  548. if os.path.exists(os.getenv("SOURCE_URL")):
  549. url_source = urlparse.urljoin(
  550. addons_url,
  551. addon_path,
  552. )
  553. else:
  554. url_source = urlparse.urljoin(
  555. os.environ["SOURCE_URL"].split("src")[0],
  556. addon_path,
  557. )
  558. else:
  559. url_source = urlparse.urljoin(source_url, pgmdir)
  560. if sys.platform == "win32":
  561. url_source = url_source.replace(os.path.sep, "/")
  562. if index_name:
  563. branches = "branches"
  564. tree = "tree"
  565. commits = "commits"
  566. if branches in url_source:
  567. url_log = url_source.replace(branches, commits)
  568. url_source = url_source.replace(branches, tree)
  569. else:
  570. url_log = url_source.replace(tree, commits)
  571. git_commit = get_last_git_commit(
  572. src_dir=curdir,
  573. addon_path=addon_path if addon_path else None,
  574. is_addon=True if addon_path else False,
  575. )
  576. if git_commit["commit"] == "unknown":
  577. date_tag = "Accessed: {date}".format(date=git_commit["date"])
  578. else:
  579. date_tag = "Latest change: {date} in commit: {commit}".format(
  580. date=git_commit["date"], commit=git_commit["commit"]
  581. )
  582. sys.stdout.write(
  583. sourcecode.substitute(
  584. URL_SOURCE=url_source,
  585. PGM=pgm,
  586. URL_LOG=url_log,
  587. DATE_TAG=date_tag,
  588. )
  589. )
  590. sys.stdout.write(
  591. footer_index.substitute(
  592. INDEXNAME=index_name,
  593. INDEXNAMECAP=index_name_cap,
  594. YEAR=year,
  595. GRASS_VERSION=grass_version,
  596. HTML_PAGE_FOOTER_PAGES_PATH=html_page_footer_pages_path,
  597. ),
  598. )
  599. else:
  600. sys.stdout.write(
  601. footer_noindex.substitute(
  602. YEAR=year,
  603. GRASS_VERSION=grass_version,
  604. HTML_PAGE_FOOTER_PAGES_PATH=html_page_footer_pages_path,
  605. ),
  606. )