Check for given filename

This commit is contained in:
Wolfgang Nowak 2022-09-29 23:18:49 +02:00
parent dc42bd5843
commit 46af61f87b

View file

@ -6,8 +6,13 @@
""" """
import sys, markdown2 as markdown import sys, markdown2 as markdown
markdown.Markdown.extras=["break-on-newline","footnotes"] markdown.Markdown.extras = ["break-on-newline", "footnotes"]
mdfile = sys.argv[1]
try:
mdfile = sys.argv[1]
except:
sys.exit("No file, honey.")
headline = mdfile.split(".md")[0] headline = mdfile.split(".md")[0]
htmlfilename = headline + ".html" htmlfilename = headline + ".html"
myhead = "<!DOCTYPE HTML><html><head><title>" + headline + "</title></head><body>" myhead = "<!DOCTYPE HTML><html><head><title>" + headline + "</title></head><body>"