From ef5f39473d61f03e53f8782b9cf3fb9c483a1a32 Mon Sep 17 00:00:00 2001 From: Wolfgang Nowak Date: Sat, 17 Apr 2021 16:21:17 +0200 Subject: [PATCH] generate html from .md and stdout from other files. New renaming of files. v0.03 --- webgen.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/webgen.py b/webgen.py index a6bfc97..d7bc7ed 100755 --- a/webgen.py +++ b/webgen.py @@ -11,21 +11,22 @@ except: ) -if parameters== "--html": - fileending=".html" +if parameters == "--html": + fileending = ".html" try: - mark_down_file = sys.argv[2] + parameters = sys.argv[2] except: sys.exit( sys.argv[0] + ": Bitte eine Text oder Markdowndatei angeben.\ Dieses Tool wandelt eine entsprechende Datei in eine einfache Webseite" ) else: - fileending="" + fileending = "" +mark_down_file = parameters -# creationtime = datetime.datetime.now().strftime("%Y-%m-%d %H ") -creationtime = datetime.datetime.now().strftime("%Y-%m-%d %H:%M") +creationtime = datetime.datetime.now().strftime("%Y-%m-%d %H:00 ") +# creationtime = 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) @@ -33,10 +34,11 @@ if re.match(".*\.md$", mark_down_file): title_of_text = re.sub(".md$", "", mark_down_file) else: html_out_file = sys.stdout + title_of_text = mark_down_file head1 = ( - '\n\ + '\n\ \n\ \n\ \n\ @@ -55,7 +57,7 @@ head1 = ( styles = "