diff --git a/webgen.py b/webgen.py index 2efe3cf..ccbe75d 100755 --- a/webgen.py +++ b/webgen.py @@ -27,10 +27,10 @@ else: mark_down_file = parameters creationtime = datetime.datetime.now().strftime("%Y-%m-%d %H:00 ") -# creationtime = datetime.datetime.now().strftime("%Y-%m-%d %H:%M") +creationtimeheader = datetime.datetime.now().strftime("%Y-%m-%d %H:%M") if re.match(".*\.md$", mark_down_file): - new_file_name = creationtime + " " + re.sub(".md$", fileending, mark_down_file) + new_file_name = creationtime + " " + re.sub(".md$", fileending, mark_down_file) html_out_file = open(new_file_name, "w") title_of_text = re.sub(".md$", "", mark_down_file) else: @@ -38,25 +38,31 @@ else: title_of_text = mark_down_file head1 = ( - '\n\\n\\n\ -\n\' + '<!DOCTYPE HTML><html><head>\n\ +<meta http-equiv="content-type" content="text/html; charset=UTF-8">\n<title>' + title_of_text + '\n\ \n\ \n\ \n\ \n" -body1 = 'Go Back' +body1 = 'Go Back' foot = " " @@ -68,4 +74,5 @@ with open(mark_down_file) as infile: html_out_file.write(a) html_out_file.write(foot) +# return new filename to stdout, so some calling shellscript can use it. print(new_file_name)