Loading md_to_docx_converter/ETSIstyles.css +4 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,10 @@ color: #121619; } .HTML-Keyboard:hover { text-decoration: underline dotted; } .HTML-Definition { font-style: italic; } Loading md_to_docx_converter/customCSS.css +8 −0 Original line number Diff line number Diff line Loading @@ -762,6 +762,10 @@ body { color: rgb(62, 72, 79); } .HTML-Keyboard { font-size: 1.06em; } /* Headers ========================================================================== */ Loading Loading @@ -1454,6 +1458,10 @@ table.no-table-stripes tbody tr { color: #62eaea; } .HTML-Keyboard:hover { color: white; } pre { background-color: #e6e6e6; border-color: #252b2f; Loading md_to_docx_converter/src/to_html/postprocessing.py +19 −0 Original line number Diff line number Diff line Loading @@ -829,6 +829,24 @@ def fix_custom_tags(soup: BeautifulSoup): return soup def add_term_links(soup: BeautifulSoup): """ Link Terms highlighted as HTML-Keyboard back to clause 3 term definitions """ for term in soup.select(".HTML-Keyboard"): text = term.get_text(strip=False) a = soup.new_tag("a", href="./clause-3.html#3.1") a.string = text for k, v in term.attrs.items(): a.attrs[k] = v term.replace_with(a) return soup def fix_lists(soup: BeautifulSoup): """ Fix lists that have been improperly nested due to markdown conversion. Loading Loading @@ -1149,6 +1167,7 @@ def postprocess(html_dir: str, no_lazy_toc: bool = False): soup = move_figure_id_to_FL_elements(soup) soup = fix_custom_tags(soup) soup = fix_lists(soup) soup = add_term_links(soup) images, soup = extract_images_from_html(soup) for image_id, image_src in images.items(): images_mapping[image_src] = { Loading Loading
md_to_docx_converter/ETSIstyles.css +4 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,10 @@ color: #121619; } .HTML-Keyboard:hover { text-decoration: underline dotted; } .HTML-Definition { font-style: italic; } Loading
md_to_docx_converter/customCSS.css +8 −0 Original line number Diff line number Diff line Loading @@ -762,6 +762,10 @@ body { color: rgb(62, 72, 79); } .HTML-Keyboard { font-size: 1.06em; } /* Headers ========================================================================== */ Loading Loading @@ -1454,6 +1458,10 @@ table.no-table-stripes tbody tr { color: #62eaea; } .HTML-Keyboard:hover { color: white; } pre { background-color: #e6e6e6; border-color: #252b2f; Loading
md_to_docx_converter/src/to_html/postprocessing.py +19 −0 Original line number Diff line number Diff line Loading @@ -829,6 +829,24 @@ def fix_custom_tags(soup: BeautifulSoup): return soup def add_term_links(soup: BeautifulSoup): """ Link Terms highlighted as HTML-Keyboard back to clause 3 term definitions """ for term in soup.select(".HTML-Keyboard"): text = term.get_text(strip=False) a = soup.new_tag("a", href="./clause-3.html#3.1") a.string = text for k, v in term.attrs.items(): a.attrs[k] = v term.replace_with(a) return soup def fix_lists(soup: BeautifulSoup): """ Fix lists that have been improperly nested due to markdown conversion. Loading Loading @@ -1149,6 +1167,7 @@ def postprocess(html_dir: str, no_lazy_toc: bool = False): soup = move_figure_id_to_FL_elements(soup) soup = fix_custom_tags(soup) soup = fix_lists(soup) soup = add_term_links(soup) images, soup = extract_images_from_html(soup) for image_id, image_src in images.items(): images_mapping[image_src] = { Loading