Commit a481ad6e authored by Marco Cavalli's avatar Marco Cavalli
Browse files

feat: get title from front-page

parent 86fde445
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -250,6 +250,13 @@ def get_md_to_html_command(

    `pandoc -f markdown <consolidated_md_path> -t chunkedhtml --wrap=none -o <dest> --css=<css_src file 1>{repeated for subsequent CSS files} --standalone --toc --toc-depth 6 --template=official.html --split-level=1 --lua-filter=md_to_html.lua --resource-path=<src>`
    """

    with open(consolidated_md_path, "r", encoding="utf-8") as f:
        md_contents = f.read()
        second_line = md_contents.splitlines()[1] if len(md_contents.splitlines()) > 1 else ""
        elements = second_line.strip().split("]")
        if len(elements) > 1 and elements[0].startswith("[ETSI"):
            title_name = elements[0][1:]  # Remove leading '['
    command = [
        "pandoc",
        "-f",
@@ -270,6 +277,7 @@ def get_md_to_html_command(
        "--lua-filter=md_to_html.lua",
        "--lua-filter=md_to_html_2.lua",
        "--lua-filter=md_to_html_3.lua",
        "--variable=title-prefix=" + title_name if 'title_name' in locals() else "''",
        f"--resource-path={src}",
    ]