Unverified Commit 349cc1b2 authored by Maxime Lefrançois's avatar Maxime Lefrançois
Browse files

correct list style in references and acronyms sections

parent 0127bb51
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -929,10 +929,6 @@ class DOCXDocumentationGenerator:

    def insert_description1(self):
        self.delete_section("User defined")
        self.new_heading(
            P_STYLE.Heading_1, f"{self.project.name} ontology and semantics"
        )

        self.insert_soup_for_file("abstract")
        self.insert_soup_for_file("description")
        self.insert_soup_for_file("examples")
@@ -993,7 +989,7 @@ class DOCXDocumentationGenerator:
        if html_path.exists():
            data = html_path.read_text(encoding="utf-8")
        elif md_path.exists():
            data = markdown(md_path.read_text(encoding="utf-8"), extensions=["extra"])
            data = markdown(md_path.read_text(encoding="utf-8"), extensions=["extra", "codehilite"])

        if not data:
            return None
@@ -1034,14 +1030,14 @@ class DOCXDocumentationGenerator:
    def set_soup_pstyle(self, el: Tag, style: P_STYLE | None = None):
        if not isinstance(self._cursor, Paragraph):
            raise ValueError()
        style = getattr(el, "data-docx-pstyle", style)
        style = el.get("data-docx-pstyle", style)
        if style:
            self._cursor.style = style

    def set_soup_cstyle(self, el: Tag, style: C_STYLE | None = None):
        if not isinstance(self._cursor, Run):
            raise ValueError()
        style = getattr(el, "data-docx-cstyle", style)
        style = el.get("data-docx-cstyle", style)
        if style:
            self._cursor.style = style

@@ -1120,7 +1116,8 @@ class DOCXDocumentationGenerator:
        if not p_style:
            logger.warning(f"No style defined for {el}")
        for li in el.find_all("li", recursive=False):
            self.new_paragraph(style=p_style)
            self.new_paragraph()
            self.set_soup_pstyle(li, p_style)
            for child in li.children:
                if isinstance(child, Tag) and child.name == "ul":
                    sub_p_style = SUB_UL_STYLE.get(p_style, None)