| 12345678910111213141516171819202122 |
- import os
- from markdown_pdf import MarkdownPdf, Section
- docs_dir = r"c:/Users/lanfr144/Documents/DOPRO1/Antigravity/Food/docs"
- md_file = os.path.join(docs_dir, "Installation_Guide.md")
- with open(md_file, "r", encoding="utf-8") as f:
- md_content = f.read()
- # Let's clean up file:/// paths just like in generate_pdfs.py
- root_dir = r"c:/Users/lanfr144/Documents/DOPRO1/Antigravity/Food"
- md_content = md_content.replace("file:///" + root_dir + "/docs/", "")
- md_content = md_content.replace("file:///" + root_dir + "/", "../")
- pdf = MarkdownPdf()
- section = Section(md_content, paper_size="A4", root=root_dir)
- html_content = pdf.add_section(section)
- print("HTML CONTENT LENGTH:", len(html_content))
- with open("scratch/inspect_html.html", "w", encoding="utf-8") as f:
- f.write(html_content)
- print("Saved HTML to scratch/inspect_html.html")
|