man_pages.py: remove extension appropriately

This commit is contained in:
George Melikov
2020-06-09 14:39:10 +03:00
parent bc46b0d624
commit 602aa9ebc3

View File

@@ -53,7 +53,8 @@ final_regex = ('<a href="../\g<num>/\g<name>.\g<num>.html" class="Xr"'
def add_hyperlinks(out_dir, pages): def add_hyperlinks(out_dir, pages):
all_pages = [] all_pages = []
for _section, section_pages in pages.items(): for _section, section_pages in pages.items():
all_pages.extend([page.split('.')[0] for page in section_pages]) all_pages.extend([
os.path.splitext(page)[0] for page in section_pages])
tmp_regex = '(?P<name>' + "|".join(all_pages) + ')' tmp_regex = '(?P<name>' + "|".join(all_pages) + ')'
html_regex = re.compile(regex_template % tmp_regex, flags=re.MULTILINE) html_regex = re.compile(regex_template % tmp_regex, flags=re.MULTILINE)