diff --git a/webgen.py b/webgen.py index 59d8594..fcb1a92 100755 --- a/webgen.py +++ b/webgen.py @@ -2,6 +2,7 @@ import sys, os, re, markdown, datetime + # Getoptions try: parameters = sys.argv[1] @@ -46,35 +47,37 @@ head1 = ( \n\ \n" -body1 = 'Go Back' +style_fn = '' + +head2 = "\n" +body1 = 'Back' foot = " " -html_out_file.write(head1 + styles + head2 + body1) +html_out_file.write(head1 + style_fn + head2 + body1) -with open(mark_down_file) as infile: - for line in infile: - a = markdown.markdown(line) - html_out_file.write(a) +with open(mark_down_file, "r", encoding="utf-8") as infile: + md_data = infile.read() + html_output = markdown.markdown(md_data) + html_out_file.write(html_output) html_out_file.write(foot) # return new filename to stdout, so some calling shellscript can use it.