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

fix hrefs in links of handbook

parent 1d6118c6
No related branches found
No related tags found
No related merge requests found
...@@ -11,9 +11,17 @@ def line_prepender(filename, line): ...@@ -11,9 +11,17 @@ def line_prepender(filename, line):
def build_link(title, href): def build_link(title, href):
# strip the number of the title # strip the number of the title
if ('handbook:1-general' in href) or ('handbook:2-additional' in href): if ('handbook-1-general' in href) or ('handbook-2-additional' in href) or ('handbook-3-annexes' in href):
title = re.sub('[0-9.]', '', title).strip() title = re.sub('[0-9.]', '', title).strip()
# remove sym link reference in href
if ('handbook-1-general' in href):
href = href.replace('handbook-1-general', 'handbook').strip()
elif ('handbook-2-additional' in href):
href = href.replace('handbook-2-additional', 'handbook').strip()
elif ('handbook-3-annexes' in href):
href = href.replace('handbook-3-annexes', 'handbook').strip()
return f'\t\t\t<li><a href="{href}">{title}</a></li>\n' return f'\t\t\t<li><a href="{href}">{title}</a></li>\n'
def build_section_start(title, shortcut): def build_section_start(title, shortcut):
......
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