2021-04-14 01:26:24 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2023-10-29 13:49:49 +01:00
|
|
|
<<<<<<< HEAD
|
2022-04-25 12:15:23 +02:00
|
|
|
import sys, os, uuid, shutil, signal, subprocess, markdown2 as markdown, re, datetime, locale, glob
|
2021-11-15 12:47:08 +01:00
|
|
|
from dialog import Dialog
|
|
|
|
|
2021-10-27 16:09:07 +02:00
|
|
|
|
2021-10-29 01:26:41 +02:00
|
|
|
# If not choosen stdout as output, where should the generated file go to and what
|
2022-07-05 17:24:45 +02:00
|
|
|
# fileending (f.e. .html) shall it have. Preset values.
|
2022-02-12 02:27:34 +01:00
|
|
|
webbasedir = os.path.expanduser("~/www/i21k.de/")
|
|
|
|
targetdir = webbasedir + "posts/"
|
2022-09-02 08:52:34 +02:00
|
|
|
sourcedir = os.path.expanduser("~/python/webgen/mds/")
|
2022-07-05 17:24:45 +02:00
|
|
|
|
2022-02-12 02:27:34 +01:00
|
|
|
### for module mkdirindex:
|
|
|
|
filesdir = webbasedir + "files/"
|
|
|
|
indexfilename = "index.html"
|
|
|
|
filesdirheadline = "Files"
|
|
|
|
####
|
|
|
|
|
2022-07-05 17:24:45 +02:00
|
|
|
# for spellchecko
|
|
|
|
# Preferred: aspell -c filename
|
|
|
|
#
|
2022-07-06 17:06:35 +02:00
|
|
|
dospellcheck = os.getenv("SPELLCHECK")
|
2022-07-05 17:24:45 +02:00
|
|
|
spellcheck = "aspell"
|
|
|
|
spellcheckparam = "-c"
|
|
|
|
|
2023-10-29 13:49:49 +01:00
|
|
|
# Configure Markdown, activate "break-on-newline" for letting a line end without havin to put doublespaces there.
|
2022-09-16 09:42:09 +02:00
|
|
|
#
|
|
|
|
# More options:
|
2022-09-12 13:13:21 +02:00
|
|
|
# break-on-newline, code-friendly, cuddled-lists, fenced-code-blocks,
|
|
|
|
# footnotes, header-ids, highlightjs-lang, html-classes, link-patterns,
|
2022-09-16 09:42:09 +02:00
|
|
|
# markdown-in-html, numbering, pyshell, smarty-pants, spoiler, strike,
|
2022-09-12 13:13:21 +02:00
|
|
|
# tag-friendly, tables, toc, use-file-vars, wiki-tables, xml
|
|
|
|
|
2022-09-16 09:42:09 +02:00
|
|
|
markdown.Markdown.extras = ["footnotes", "break-on-newline"]
|
2022-09-12 13:13:21 +02:00
|
|
|
|
2021-10-27 16:09:07 +02:00
|
|
|
fileending = ""
|
2021-11-28 15:47:26 +01:00
|
|
|
locale.setlocale(locale.LC_ALL, "")
|
|
|
|
clear = "\x1b[2J\x1b[H"
|
2021-12-04 16:11:47 +01:00
|
|
|
green = "\x1b[38;5;46m"
|
|
|
|
red = "\x1b[38;5;9m"
|
|
|
|
yellow = "\x1b[38;5;226m"
|
|
|
|
greenonblack = "\x1b[38;5;46m\x1b[48;5;16m"
|
|
|
|
redonblack = "\x1b[38;5;9m\x1b[48;5;16m"
|
|
|
|
|
2021-11-28 15:47:26 +01:00
|
|
|
xwidth = os.get_terminal_size()[0] - 3
|
|
|
|
ywidth = os.get_terminal_size()[1] - 3
|
|
|
|
os.chdir(sourcedir)
|
|
|
|
# Prepend an hourly tinestamp to the later name of the file
|
|
|
|
creationtime = datetime.datetime.now().strftime("%Y-%m-%d %H:00 ")
|
|
|
|
# generate a more precise ctime to be included in the resulting webpage
|
|
|
|
creationtimeheader = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
|
|
|
|
|
|
|
|
|
|
|
|
# Initialize a dialog.Dialog instance
|
|
|
|
d = Dialog(dialog="dialog")
|
2021-10-27 16:09:07 +02:00
|
|
|
|
2021-12-04 16:11:47 +01:00
|
|
|
# Let's stop everything at CTRL-c
|
|
|
|
|
|
|
|
|
|
|
|
def sigint_handler(signum, frame):
|
|
|
|
sys.exit(yellow + "\nPfff....I'll tell your mom!\n")
|
|
|
|
|
|
|
|
|
|
|
|
signal.signal(signal.SIGINT, sigint_handler)
|
|
|
|
|
|
|
|
|
2021-10-29 01:26:41 +02:00
|
|
|
# call favorite editor with filename to write the text
|
2022-07-05 17:24:45 +02:00
|
|
|
# i am not shure bout that spellchecko, is it nessesary?
|
|
|
|
|
|
|
|
|
2021-10-27 16:09:07 +02:00
|
|
|
def edit(headline):
|
|
|
|
editor = os.getenv("EDITOR")
|
|
|
|
if not editor:
|
|
|
|
editor = "vim"
|
|
|
|
subprocess.call([editor, headline])
|
2022-07-06 17:06:35 +02:00
|
|
|
if dospellcheck:
|
2022-07-05 17:24:45 +02:00
|
|
|
print(yellow)
|
2022-07-27 13:33:57 +02:00
|
|
|
if input("You like to spellcheck it first [y/N]?") == "y":
|
2022-07-05 17:24:45 +02:00
|
|
|
subprocess.call([spellcheck, spellcheckparam, headline])
|
|
|
|
print(green)
|
2021-10-27 16:09:07 +02:00
|
|
|
return headline
|
|
|
|
|
2021-04-14 12:59:22 +02:00
|
|
|
|
2021-11-28 15:47:26 +01:00
|
|
|
# Select a topic for the new post or reedit an existing one
|
2021-11-20 18:20:53 +01:00
|
|
|
def selectfile():
|
2021-12-04 01:38:54 +01:00
|
|
|
# Put all .md files in sourcefolder into list with a format, which dialog can eat.
|
2021-12-06 14:57:16 +01:00
|
|
|
|
|
|
|
filelist = glob.glob("*.md")
|
|
|
|
filelist.sort()
|
2021-11-28 15:47:26 +01:00
|
|
|
tabelle = []
|
2021-12-06 14:57:16 +01:00
|
|
|
zahl = 0
|
|
|
|
for zeile in filelist:
|
2021-11-28 15:47:26 +01:00
|
|
|
tabelle.insert(zahl, (str(zahl), zeile))
|
|
|
|
zahl += 1
|
|
|
|
|
|
|
|
# Open list in menu and let user choose one
|
|
|
|
ausgewaehlt = d.menu(
|
|
|
|
"Such dir ne Datei:",
|
|
|
|
width=xwidth,
|
|
|
|
height=ywidth,
|
|
|
|
menu_height=ywidth,
|
|
|
|
title="Ein Thema wählen:",
|
|
|
|
choices=tabelle,
|
|
|
|
cancel="Neuen Namen eingeben",
|
|
|
|
)
|
|
|
|
|
2021-12-04 01:38:54 +01:00
|
|
|
# Nothing has been choosen, so lets ask for a topic to generate a filename
|
2021-11-28 15:47:26 +01:00
|
|
|
if ausgewaehlt[0] == "cancel":
|
|
|
|
newtopic = d.inputbox("Ok, gib hier ein neues Thema an:", width=xwidth, height=ywidth, title="Ein Thema wählen:", cancel="Exit")
|
|
|
|
if newtopic[0] == "cancel" or newtopic[1] == "":
|
2021-12-04 16:11:47 +01:00
|
|
|
sys.exit(yellow + "Na, dann eben nicht...")
|
2021-11-28 15:47:26 +01:00
|
|
|
headline = newtopic[1]
|
|
|
|
else:
|
|
|
|
headline = ""
|
|
|
|
|
|
|
|
# Clean filename from leading .md for later construction of a headline
|
|
|
|
if headline == "":
|
2021-12-04 16:11:47 +01:00
|
|
|
|
2021-11-28 15:47:26 +01:00
|
|
|
headline = re.sub("\.md$", "", tabelle[int(ausgewaehlt[1])][1])
|
2021-12-04 16:11:47 +01:00
|
|
|
print(headline)
|
2022-06-11 15:55:23 +02:00
|
|
|
# a = input(yellow + "What do we dooo here?")
|
2021-11-28 15:47:26 +01:00
|
|
|
|
|
|
|
# if the searched filename doesnt match an existing file we construct a new one
|
|
|
|
if len(glob.glob(sourcedir + headline + ".md")) == 0:
|
|
|
|
sourcefile = sourcedir + headline + ".md"
|
|
|
|
else:
|
|
|
|
sourcefile = str(glob.glob(sourcedir + headline + ".md")[0])
|
|
|
|
|
|
|
|
# if the targetfilename doesnt match an existing file we construct a new one
|
|
|
|
targetfile = glob.glob(targetdir + "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-2][0-9]:[0-6][0-9] " + headline + "*")
|
|
|
|
targetfilelength = len(targetfile)
|
|
|
|
if targetfilelength >= 1:
|
|
|
|
targetfile = targetfile[targetfilelength - 1]
|
|
|
|
else:
|
|
|
|
targetfile = targetdir + datetime.datetime.now().strftime("%Y-%m-%d %H:00 ") + headline
|
|
|
|
|
|
|
|
return sourcefile, targetfile, headline
|
2021-11-20 18:20:53 +01:00
|
|
|
|
2022-06-11 15:55:23 +02:00
|
|
|
|
2022-02-12 02:58:04 +01:00
|
|
|
def mkdirindex(filesdir, indexfilename, filesdirheadline):
|
|
|
|
"""Dig the files-directory and generate an index."""
|
|
|
|
|
|
|
|
head1 = (
|
|
|
|
'<!DOCTYPE HTML><html><head>\n <meta http-equiv="content-type" content="text/html; charset=UTF-8">\n<title>'
|
|
|
|
+ filesdirheadline
|
|
|
|
+ '</title>\n <meta name="syntax" content="markdown">\n <meta name="generator" content="'
|
|
|
|
+ "webgen.py"
|
|
|
|
+ ' markdown2htmlconverter">\n <meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy=">'
|
|
|
|
)
|
|
|
|
|
|
|
|
style_fn = '<link rel="stylesheet" type="text/css" href="/vimstyles.css">'
|
2023-08-31 19:48:51 +02:00
|
|
|
head2 = "</head><body><div id='print'><img src=\"/copyright.jpg\" />XXXXXXXX</div>\n"
|
2022-02-12 02:58:04 +01:00
|
|
|
body1 = '<a class="Statement" href="../">Back</a><br/><br/><hr>'
|
|
|
|
body1 += '<div class="Statement"> Some files. Maybe useful or not.</div> '
|
|
|
|
body1 += '<table border="0" class="Neutral">'
|
2022-09-16 09:42:09 +02:00
|
|
|
foot = '</table><br/><strong>You can\'t avoid chaos.</strong><br/><hr class="myhr" ></body> </html>\n'
|
2022-06-11 15:55:23 +02:00
|
|
|
linecounter = 0
|
2022-02-12 02:58:04 +01:00
|
|
|
|
|
|
|
dirindexfile = open(filesdir + indexfilename, "w")
|
|
|
|
|
|
|
|
dirindexfile.write(head1 + style_fn + head2 + body1)
|
|
|
|
|
|
|
|
for file in os.listdir(filesdir):
|
|
|
|
if not re.match("^\.", file) and not file == indexfilename:
|
|
|
|
size = os.lstat(filesdir + file).st_size
|
|
|
|
if size > 100000000000:
|
|
|
|
sizestr = str(int(size / 1073741824)) + " GiB"
|
|
|
|
elif size > 100000000:
|
|
|
|
sizestr = str(int(size / 1048576)) + " MiB"
|
|
|
|
elif size > 10000:
|
|
|
|
sizestr = str(int(size / 1024)) + " KiB"
|
|
|
|
else:
|
|
|
|
sizestr = str(size) + " B"
|
|
|
|
|
|
|
|
line = str('<tr><td><a href="' + str(file) + '">' + str(file) + "</a></td><td> " + sizestr + "</td></tr>")
|
|
|
|
dirindexfile.write(line)
|
2022-06-11 15:55:23 +02:00
|
|
|
linecounter += 1
|
2022-02-12 02:58:04 +01:00
|
|
|
|
|
|
|
dirindexfile.write(foot)
|
|
|
|
return linecounter
|
|
|
|
|
|
|
|
|
2022-07-06 17:06:35 +02:00
|
|
|
# Parse arguments "--html", "--stdout", --spellcheck and "Some Headline"
|
2021-10-29 01:26:41 +02:00
|
|
|
# there are 3 parameters. if --html is given, the fileending will be .html.
|
|
|
|
# Else, if stdout is choosen there can be no fileending, but it will still contain html
|
|
|
|
# the name of the program is stored in myname
|
|
|
|
# dont set a name to outfile, it just is initialised here and will be overwritten
|
2021-10-27 16:09:07 +02:00
|
|
|
|
2022-07-06 17:06:35 +02:00
|
|
|
optwords = ["--html", "--stdout", "--spellcheck"]
|
2021-10-28 18:54:10 +02:00
|
|
|
outfile = ""
|
|
|
|
args = sys.argv
|
|
|
|
myname = args.pop(0)
|
|
|
|
for wish in optwords:
|
|
|
|
if args.count(wish):
|
|
|
|
if wish == "--html":
|
|
|
|
fileending = ".html"
|
|
|
|
args.pop(args.index(wish))
|
2022-07-06 17:06:35 +02:00
|
|
|
if wish == "--spellcheck":
|
|
|
|
dospellcheck = "y"
|
|
|
|
args.pop(args.index(wish))
|
2021-10-28 18:54:10 +02:00
|
|
|
if wish == "--stdout":
|
|
|
|
outfile = sys.stdout
|
|
|
|
args.pop(args.index(wish))
|
2021-11-28 15:47:26 +01:00
|
|
|
# Check, if that topic already exists and fetch the appropriate filename
|
2021-10-28 18:54:10 +02:00
|
|
|
if len(args) == 1:
|
|
|
|
headline = args[0]
|
2021-11-28 15:47:26 +01:00
|
|
|
inputfile = headline + ".md"
|
2021-12-04 16:11:47 +01:00
|
|
|
outputfile = glob.glob(
|
|
|
|
targetdir + "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-2][0-9]:[0-6][0-9] " + headline + "*" + fileending
|
|
|
|
)
|
2021-11-28 15:47:26 +01:00
|
|
|
outputfilelength = len(outputfile)
|
|
|
|
if outputfilelength >= 1:
|
|
|
|
outputfile = outputfile[outputfilelength - 1]
|
|
|
|
else:
|
2021-12-04 16:11:47 +01:00
|
|
|
outputfile = targetdir + datetime.datetime.now().strftime("%Y-%m-%d %H:00 ") + headline + fileending
|
2021-11-28 15:47:26 +01:00
|
|
|
|
|
|
|
|
2021-10-28 18:54:10 +02:00
|
|
|
elif len(args) == 0:
|
2021-11-28 15:47:26 +01:00
|
|
|
selection = selectfile()
|
|
|
|
inputfile = selection[0]
|
2021-12-04 16:11:47 +01:00
|
|
|
outputfile = selection[1] + fileending
|
2021-11-28 15:47:26 +01:00
|
|
|
headline = selection[2]
|
2021-10-28 18:54:10 +02:00
|
|
|
elif len(args) > 1:
|
2021-12-04 16:11:47 +01:00
|
|
|
sys.exit(red + "Too much or wrong parameters:\n" + yellow + myname + ' [--html] [--stdout] ["Some Topic"] ')
|
2021-10-27 16:09:07 +02:00
|
|
|
|
|
|
|
|
2021-10-29 01:26:41 +02:00
|
|
|
# This is informal asking yes/no for editing the text
|
2021-11-28 15:47:26 +01:00
|
|
|
if outfile == sys.stdout:
|
|
|
|
outputfile = "STDOUT"
|
2021-12-04 16:11:47 +01:00
|
|
|
print(yellow + "\nYou will edit now: '" + green + inputfile + yellow + "'\nOutputfile= '" + green + outputfile + "'")
|
2021-11-28 15:47:26 +01:00
|
|
|
a = input("\nPress <RETURN> to continue or <CTRL-C> to stop: ")
|
|
|
|
edit(inputfile)
|
2021-10-27 19:21:02 +02:00
|
|
|
|
2021-10-29 01:26:41 +02:00
|
|
|
|
|
|
|
# Set ouput to stdout, if requested. Caution, the prompts of this script go there, too,
|
|
|
|
# be careful with copy & paste
|
2021-10-28 18:54:10 +02:00
|
|
|
if outfile != sys.stdout:
|
2021-11-28 15:47:26 +01:00
|
|
|
html_out_file = open(outputfile, "w")
|
2021-10-28 18:54:10 +02:00
|
|
|
else:
|
|
|
|
html_out_file = outfile
|
2021-04-14 01:26:24 +02:00
|
|
|
|
2021-10-29 01:26:41 +02:00
|
|
|
# The head of the output. Strip path from myname
|
2021-04-14 01:26:24 +02:00
|
|
|
head1 = (
|
2021-04-23 20:15:14 +02:00
|
|
|
'<!DOCTYPE HTML><html><head>\n\
|
2021-11-15 12:43:52 +01:00
|
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">\n<title>'
|
2021-10-27 19:21:02 +02:00
|
|
|
+ headline
|
2021-04-14 01:26:24 +02:00
|
|
|
+ '</title>\n\
|
|
|
|
<meta name="syntax" content="markdown">\n\
|
2021-10-25 08:11:36 +02:00
|
|
|
<meta name="generator" content="'
|
2021-10-29 01:26:41 +02:00
|
|
|
+ myname.rpartition("/")[2]
|
2021-10-25 08:11:36 +02:00
|
|
|
+ ' markdown2htmlconverter">\n\
|
2021-04-14 01:26:24 +02:00
|
|
|
<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy=">\n\
|
|
|
|
<meta name="ctime" content="'
|
2021-04-23 20:15:14 +02:00
|
|
|
+ creationtimeheader
|
2021-10-14 00:11:27 +02:00
|
|
|
+ '"> '
|
2021-04-14 01:26:24 +02:00
|
|
|
)
|
|
|
|
|
2021-10-27 19:21:02 +02:00
|
|
|
# Some fancy css for minimalistic terminal style
|
|
|
|
|
2022-06-11 15:55:23 +02:00
|
|
|
|
2021-10-27 19:21:02 +02:00
|
|
|
style_fn = '<link rel="stylesheet" type="text/css" href="/vimstyles.css">'
|
2023-08-31 19:48:51 +02:00
|
|
|
head2 = "</head><body>\n<div id='print'><img src=\"/copyright.jpg\" />XXXXXXXX</div>\n"
|
2022-02-12 02:27:34 +01:00
|
|
|
body1 = '<a href="./">Back</a><blockquote><strong>Moin</strong></p>'
|
2023-08-31 19:48:51 +02:00
|
|
|
foot = '<br /><hr class="myhr" />\n</body> </html>\n'
|
2021-04-14 01:26:24 +02:00
|
|
|
|
2021-10-29 01:26:41 +02:00
|
|
|
# write beginning of html-file
|
2021-10-29 01:36:02 +02:00
|
|
|
html_out_file.write(head1 + style_fn + head2 + body1)
|
2021-04-14 01:26:24 +02:00
|
|
|
|
2021-10-29 01:26:41 +02:00
|
|
|
# The centerpiece - read md-file, convert to html, add head and foot and write result
|
2021-11-28 15:47:26 +01:00
|
|
|
with open(inputfile, "r", encoding="utf-8") as infile:
|
2021-10-14 00:11:27 +02:00
|
|
|
md_data = infile.read()
|
|
|
|
html_output = markdown.markdown(md_data)
|
|
|
|
html_out_file.write(html_output)
|
2021-04-14 01:26:24 +02:00
|
|
|
html_out_file.write(foot)
|
2021-10-27 19:21:02 +02:00
|
|
|
html_out_file.close()
|
2021-04-17 16:21:17 +02:00
|
|
|
|
2021-10-29 01:26:41 +02:00
|
|
|
# if the new filename is not stdout, return new filename to stdout, so some calling shellscript can use it.
|
2021-10-28 18:56:02 +02:00
|
|
|
if outfile != sys.stdout:
|
2021-11-28 15:47:26 +01:00
|
|
|
print(outputfile)
|
2021-10-29 01:26:41 +02:00
|
|
|
|
2022-01-30 01:08:43 +01:00
|
|
|
# Dig the files-directory and generate an index.
|
2022-06-11 15:55:23 +02:00
|
|
|
linecounter = mkdirindex(filesdir, indexfilename, filesdirheadline)
|
|
|
|
print("Dirindex in ", filesdir, " has ", linecounter, "lines")
|
2022-02-12 02:27:34 +01:00
|
|
|
|
2021-10-29 01:26:41 +02:00
|
|
|
# Have a nice time.
|
2023-10-29 13:49:49 +01:00
|
|
|
=======
|
|
|
|
import sys, os, re, markdown, datetime
|
|
|
|
|
|
|
|
try:
|
|
|
|
mark_down_file = sys.argv[1]
|
|
|
|
except:
|
|
|
|
sys.exit(
|
|
|
|
sys.argv[0]
|
|
|
|
+ ": Bitte eine Text oder Markdowndatei angeben.\ Dieses Tool wandelt eine entsprechende Datei in eine einfache Webseite"
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
creationtime = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
|
|
|
|
|
|
|
|
if re.match(".*\.md$", mark_down_file):
|
|
|
|
new_file_name = creationtime + " " + re.sub(".md$", ".html", mark_down_file)
|
|
|
|
html_out_file = open(new_file_name, "w")
|
|
|
|
title_of_text = re.sub(".md$", "", mark_down_file)
|
|
|
|
else:
|
|
|
|
html_out_file = sys.stdout
|
|
|
|
|
|
|
|
|
|
|
|
head1 = (
|
|
|
|
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\n\
|
|
|
|
<html>\n\
|
|
|
|
<head>\n\
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">\n\
|
|
|
|
<title>'
|
|
|
|
+ title_of_text
|
|
|
|
+ '</title>\n\
|
|
|
|
<meta name="Generator" content="Vim/8.1">\n\
|
|
|
|
<meta name="plugin-version" content="vim8.1_v1">\n\
|
|
|
|
<meta name="syntax" content="markdown">\n\
|
|
|
|
<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy=">\n\
|
|
|
|
<meta name="ctime" content="'
|
|
|
|
+ creationtime
|
|
|
|
+ '">\n\
|
|
|
|
<style type="text/css"> '
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
styles = " <!--\n\
|
|
|
|
* { font-family: monospace; color: #00f020; background-color: #1c1414; font-size: 1.1em; text-decoration: none; }\n\
|
|
|
|
body { font-family: monospace; }\n\
|
|
|
|
pre { white-space: pre-wrap; font-family: monospace; color: #00f020; background-color: #1c1414; }\n\
|
|
|
|
.Statement { color: #00f020; font-weight: bold; }\n\
|
|
|
|
-->\n"
|
|
|
|
head2 = "</style> </head><body>\n"
|
|
|
|
body1 = '<a href="../" >Go back to upper folder</a>'
|
|
|
|
foot = "</body> </html>"
|
|
|
|
|
|
|
|
|
|
|
|
html_out_file.write(head1 + styles + head2 + body1)
|
|
|
|
|
|
|
|
with open(mark_down_file) as infile:
|
|
|
|
for line in infile:
|
|
|
|
a = markdown.markdown(line)
|
|
|
|
html_out_file.write(a)
|
|
|
|
html_out_file.write(foot)
|
|
|
|
>>>>>>> 6dd9be7 (Generate a blog htmlpage from a markdownfile. v0.01)
|