html.xonsh/readFile.py

29 lines
724 B
Python
Executable File

#!/usr/bin/python
import markdown
# Only do the <body> tag
class readMarkdown():
outStr = ""
mdFile = ""
def __init__(self, mdFile):
self.outStr = ""
self.mdFile = mdFile
def markdown(self, mdFile):
print("placeholder")
file = open(mdFile, 'r')
#middleVar = file.read()
self.outStr = str(markdown.markdown(file.read())) #TODO: I really want nice tab indentations
file.close()
return(self.outStr)
def __str__(self):
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