2022-03-03 02:00:20 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
2022-03-03 02:40:58 +00:00
|
|
|
import markdown
|
2022-03-03 02:00:20 +00:00
|
|
|
|
|
|
|
# Only do the <body> tag
|
2022-03-03 02:40:58 +00:00
|
|
|
class readMarkdown():
|
2022-03-03 02:00:20 +00:00
|
|
|
outStr = ""
|
|
|
|
mdFile = ""
|
|
|
|
|
|
|
|
def __init__(self, mdFile):
|
2022-03-03 03:59:46 +00:00
|
|
|
self.outStr = ""
|
2022-03-03 02:40:58 +00:00
|
|
|
self.mdFile = mdFile
|
2022-03-03 02:00:20 +00:00
|
|
|
|
2022-03-03 02:40:58 +00:00
|
|
|
|
|
|
|
def markdown(self, mdFile):
|
2022-03-03 02:00:20 +00:00
|
|
|
print("placeholder")
|
2022-03-03 02:40:58 +00:00
|
|
|
|
|
|
|
file = open(mdFile, 'r')
|
|
|
|
#middleVar = file.read()
|
2022-03-03 03:59:46 +00:00
|
|
|
self.outStr = str(markdown.markdown(file.read()))
|
|
|
|
file.close()
|
|
|
|
return(self.outStr)
|
|
|
|
|
2022-03-03 02:00:20 +00:00
|
|
|
|
|
|
|
def __str__(self):
|
2022-03-03 03:59:46 +00:00
|
|
|
return(str(self.markdown(self.mdFile)))
|
2022-03-03 02:40:58 +00:00
|
|
|
|
|
|
|
# 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
|