diff --git a/main.py b/main.py index 907c813..1fa9e2a 100755 --- a/main.py +++ b/main.py @@ -2,29 +2,27 @@ import readFile -inFile = "" outFile = "" #outFile = outFile + ".html" timeCreate = 0 #Do I want this to be a str? timeMod = 0 -sTitle = "" +m2h = "" # markdown 2 html - - -def printHtml(): +def printHtml(body): print("placeholder") file = open(outFile, 'w') - + file.write(str(body)) + file.close() -def parseMd(title, inFile): - print("probably not gonna use") +def parseMd(inFile): + m2h = readFile.readMarkdown(inFile) + return(m2h) def metadata(): print("placeholder") - def css(): print("placeholder") @@ -32,6 +30,7 @@ def main(): print("placeholder") def test(): - print(readFile.readMarkdown("/home/amber/website.sh/sample.md")) + #print(readFile.readMarkdown("/home/amber/website.sh/sample.md")) + print(parseMd("sample.md")) -#test() \ No newline at end of file +test() \ No newline at end of file diff --git a/readFile.py b/readFile.py index 327918a..802a885 100755 --- a/readFile.py +++ b/readFile.py @@ -8,7 +8,7 @@ class readMarkdown(): mdFile = "" def __init__(self, mdFile): - outStr = "" + self.outStr = "" self.mdFile = mdFile @@ -17,10 +17,13 @@ class readMarkdown(): file = open(mdFile, 'r') #middleVar = file.read() - outStr = str(markdown.markdown(file.read())) + self.outStr = str(markdown.markdown(file.read())) + file.close() + return(self.outStr) + def __str__(self): - return(str(outStr)) + return(str(self.markdown(self.mdFile))) # might want to find a way to diff html from a file and readMarkdown()'s output if I want to update pages # Edit: just keep the original markdown files dumbass \ No newline at end of file