removed test md and fixed some whitespace
This commit is contained in:
+1
-15
@@ -3,26 +3,12 @@ from pathlib import Path
|
|||||||
from mdtohtml import mdtohtml
|
from mdtohtml import mdtohtml
|
||||||
from htmltopdf import htmltopdf
|
from htmltopdf import htmltopdf
|
||||||
|
|
||||||
md = """
|
|
||||||
#This is a header
|
|
||||||
|
|
||||||
THis is a paragrah with **bold** text
|
|
||||||
|
|
||||||
This is *italic* text
|
|
||||||
|
|
||||||
and and unordered list
|
|
||||||
- one item
|
|
||||||
- two item
|
|
||||||
- three item
|
|
||||||
"""
|
|
||||||
|
|
||||||
srcdir = Path("markdown")
|
srcdir = Path("markdown")
|
||||||
destdir = Path("publish")
|
destdir = Path("publish")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("Hello from resume!")
|
print("Hello from resume!")
|
||||||
html = mdtohtml(md)
|
|
||||||
print(html)
|
|
||||||
|
|
||||||
# html
|
# html
|
||||||
# process all files ending with '.md' in srcdir to html
|
# process all files ending with '.md' in srcdir to html
|
||||||
@@ -42,7 +28,7 @@ def main():
|
|||||||
outfile = destdir / infile.name
|
outfile = destdir / infile.name
|
||||||
outfile = outfile.with_suffix(".html")
|
outfile = outfile.with_suffix(".html")
|
||||||
htmlfiles.append(outfile)
|
htmlfiles.append(outfile)
|
||||||
print(f" processing '{infile}' to '{outfile}'")
|
print(f"processing '{infile}' to '{outfile}'")
|
||||||
with infile.open(mode='r', encoding='utf-8') as f:
|
with infile.open(mode='r', encoding='utf-8') as f:
|
||||||
mdsrc = f.read()
|
mdsrc = f.read()
|
||||||
html = mdtohtml(mdsrc)
|
html = mdtohtml(mdsrc)
|
||||||
|
|||||||
Reference in New Issue
Block a user