Skip to content

Commit

Permalink
mkhtml: enable path setting for footer html pages (topics.html...) on…
Browse files Browse the repository at this point in the history
… add-on manual page (#1122)

(required to compile add-ons to properly create server-side html man pages)
  • Loading branch information
tmszi committed Dec 2, 2020
1 parent 8d784d1 commit 43dbfb0
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions tools/mkhtml.py
Expand Up @@ -112,11 +112,11 @@ def decode(bytes_):
"""<hr class="header">
<p>
<a href="index.html">Main index</a> |
<a href="${INDEXNAME}.html">${INDEXNAMECAP} index</a> |
<a href="topics.html">Topics index</a> |
<a href="keywords.html">Keywords index</a> |
<a href="graphical_index.html">Graphical index</a> |
<a href="full_index.html">Full index</a>
<a href="${HTML_PAGE_FOOTER_PAGES_PATH}${INDEXNAME}.html">${INDEXNAMECAP} index</a> |
<a href="${HTML_PAGE_FOOTER_PAGES_PATH}topics.html">Topics index</a> |
<a href="${HTML_PAGE_FOOTER_PAGES_PATH}keywords.html">Keywords index</a> |
<a href="${HTML_PAGE_FOOTER_PAGES_PATH}graphical_index.html">Graphical index</a> |
<a href="${HTML_PAGE_FOOTER_PAGES_PATH}full_index.html">Full index</a>
</p>
<p>
&copy; 2003-${YEAR}
Expand All @@ -133,10 +133,10 @@ def decode(bytes_):
"""<hr class="header">
<p>
<a href="index.html">Main index</a> |
<a href="topics.html">Topics index</a> |
<a href="keywords.html">Keywords index</a> |
<a href="graphical_index.html">Graphical index</a> |
<a href="full_index.html">Full index</a>
<a href="${HTML_PAGE_FOOTER_PAGES_PATH}topics.html">Topics index</a> |
<a href="${HTML_PAGE_FOOTER_PAGES_PATH}keywords.html">Keywords index</a> |
<a href="${HTML_PAGE_FOOTER_PAGES_PATH}graphical_index.html">Graphical index</a> |
<a href="${HTML_PAGE_FOOTER_PAGES_PATH}full_index.html">Full index</a>
</p>
<p>
&copy; 2003-${YEAR}
Expand Down Expand Up @@ -406,6 +406,9 @@ def to_title(name):
if sys.platform == 'win32':
url_source = url_source.replace(os.path.sep, '/')

html_page_footer_pages_path = os.getenv('HTML_PAGE_FOOTER_PAGES_PATH') if \
os.getenv('HTML_PAGE_FOOTER_PAGES_PATH') else ''

if index_name:
tree = 'grass/tree'
commits = 'grass/commits'
Expand All @@ -421,10 +424,20 @@ def to_title(name):
sys.stdout.write(sourcecode.substitute(
URL_SOURCE=url_source, PGM=pgm, URL_LOG=url_source.replace(
tree, commits)))
sys.stdout.write(footer_index.substitute(INDEXNAME=index_name,
INDEXNAMECAP=index_name_cap,
YEAR=year,
GRASS_VERSION=grass_version))
sys.stdout.write(
footer_index.substitute(
INDEXNAME=index_name,
INDEXNAMECAP=index_name_cap,
YEAR=year,
GRASS_VERSION=grass_version,
HTML_PAGE_FOOTER_PAGES_PATH=html_page_footer_pages_path,
),
)
else:
sys.stdout.write(footer_noindex.substitute(YEAR=year,
GRASS_VERSION=grass_version))
sys.stdout.write(
footer_noindex.substitute(
YEAR=year,
GRASS_VERSION=grass_version,
HTML_PAGE_FOOTER_PAGES_PATH=html_page_footer_pages_path,
),
)

0 comments on commit 43dbfb0

Please sign in to comment.