#!/usr/bin/python import readFile import datetime #outFile = outFile + ".html" timeCreate = "" timeMod = "" m2h = "" # markdown 2 html headerStr = "" footStr = "\n" def printHtml(head, body, foot, outFile): print("placeholder") file = open(outFile, 'w') file.write(str(head + body + foot)) file.close() def parseMd(inFile): global m2h m2h = str(readFile.readMarkdown(inFile)) return(m2h) def metadata(inFile): # Read metadata from possible file ## Pretend there's code here # Generate metadata getTime = datetime.datetime.now() timeMod = str(getTime.strftime("%A, %B %d, %Y at %X UTC−06:00")) #TODO: I don't want to hard-code this but the %z utc offset isn't printing timeCreate = timeMod title = inFile.split(".") title = str(title[0]) #TODO: figure out a way to make longer titles without putting spaces in the filename # Take title as optional command-line arguement # Generate html global headerStr headerStr = """\ """ headerStr1 = """ """ headerStr = headerStr + str(title) + headerStr1 + timeMod + headerStr2 + timeCreate + headerStr3 return(str(headerStr)) def css(): print("placeholder") def main(): metadata("sample.md") parseMd("sample.md") printHtml(headerStr, m2h, footStr, "outdir/index.html") def test(): #print(readFile.readMarkdown("/home/amber/website.sh/sample.md")) print(parseMd("sample.md")) metadata("sample.md") main()