Skip to content
Snippets Groups Projects
Verified Commit a2ac7904 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

add index to id in header

parent 1e955726
No related branches found
No related tags found
No related merge requests found
......@@ -11,13 +11,13 @@ def line_prepender(filename, line):
def build_link(title, href):
return f'\t\t\t<li><a href="{href}">{title}</a></li>\n'
def build_section_start(title):
def build_section_start(title, shortcut):
title = title.replace("Gdpr", "GDPR")
title = title.replace("Handbook", "PI Handbook")
title = title.replace("Covid 19", "COVID-19")
return f'\n\t<div class="index-box">\n\t\t<h3>{title}</h3>\n\t\t<ul>\n'
return f'\n\t<div class="index-box" id="{shortcut}">\n\t\t<h3>{title}</h3>\n\t\t<ul>\n'
def build_section_end():
return "\t\t</ul>\n\t</div>"
......@@ -176,7 +176,7 @@ print(localIndexArr)
# determine the index
k = 0
for s in sections:
index += build_section_start(s.replace("-", " ").capitalize())
index += build_section_start(s.replace("-", " ").capitalize(), s)
index += ''.join(localIndexArr[k])
index += build_section_end()
k += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment