diff --git a/TODO b/TODO index eef2d42..4fbe774 100644 --- a/TODO +++ b/TODO @@ -1,2 +1,5 @@ Multiple template files - +Nice HTML tabs +Don't hard-code timezone +Build system +Take input file as a command-line arguement diff --git a/main.py b/main.py index 1fa9e2a..336da33 100755 --- a/main.py +++ b/main.py @@ -1,11 +1,12 @@ #!/usr/bin/python import readFile +import datetime outFile = "" #outFile = outFile + ".html" -timeCreate = 0 #Do I want this to be a str? -timeMod = 0 +timeCreate = "" +timeMod = "" m2h = "" # markdown 2 html @@ -20,8 +21,18 @@ def parseMd(inFile): m2h = readFile.readMarkdown(inFile) return(m2h) -def metadata(): - print("placeholder") +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 + def css(): print("placeholder") @@ -33,4 +44,6 @@ def test(): #print(readFile.readMarkdown("/home/amber/website.sh/sample.md")) print(parseMd("sample.md")) + metadata("sample.md") + test() \ No newline at end of file diff --git a/readFile.py b/readFile.py index 802a885..15c2640 100755 --- a/readFile.py +++ b/readFile.py @@ -17,7 +17,7 @@ class readMarkdown(): file = open(mdFile, 'r') #middleVar = file.read() - self.outStr = str(markdown.markdown(file.read())) + self.outStr = str(markdown.markdown(file.read())) #TODO: I really want nice tab indentations file.close() return(self.outStr) diff --git a/requirements b/requirements index 760883c..350e0a0 100644 --- a/requirements +++ b/requirements @@ -1,2 +1,2 @@ python -python-markdown \ No newline at end of file +python-markdown https://python-markdown.github.io/