From 46af61f87b43355cd37760960c47e930bd8662c7 Mon Sep 17 00:00:00 2001 From: Wolfgang Nowak Date: Thu, 29 Sep 2022 23:18:49 +0200 Subject: [PATCH] Check for given filename --- md2html.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/md2html.py b/md2html.py index 7cd2ec9..a6a48a6 100755 --- a/md2html.py +++ b/md2html.py @@ -6,8 +6,13 @@ """ import sys, markdown2 as markdown -markdown.Markdown.extras=["break-on-newline","footnotes"] -mdfile = sys.argv[1] +markdown.Markdown.extras = ["break-on-newline", "footnotes"] + +try: + mdfile = sys.argv[1] +except: + sys.exit("No file, honey.") + headline = mdfile.split(".md")[0] htmlfilename = headline + ".html" myhead = "" + headline + ""