readfile.py works now
This commit is contained in:
parent
1c5f97d4ce
commit
a5850ba2ec
21
main.py
21
main.py
|
@ -2,29 +2,27 @@
|
||||||
|
|
||||||
import readFile
|
import readFile
|
||||||
|
|
||||||
inFile = ""
|
|
||||||
outFile = ""
|
outFile = ""
|
||||||
#outFile = outFile + ".html"
|
#outFile = outFile + ".html"
|
||||||
timeCreate = 0 #Do I want this to be a str?
|
timeCreate = 0 #Do I want this to be a str?
|
||||||
timeMod = 0
|
timeMod = 0
|
||||||
sTitle = ""
|
m2h = "" # markdown 2 html
|
||||||
|
|
||||||
|
|
||||||
|
def printHtml(body):
|
||||||
|
|
||||||
def printHtml():
|
|
||||||
print("placeholder")
|
print("placeholder")
|
||||||
file = open(outFile, 'w')
|
file = open(outFile, 'w')
|
||||||
|
file.write(str(body))
|
||||||
|
|
||||||
|
file.close()
|
||||||
|
|
||||||
def parseMd(title, inFile):
|
def parseMd(inFile):
|
||||||
print("probably not gonna use")
|
m2h = readFile.readMarkdown(inFile)
|
||||||
|
return(m2h)
|
||||||
|
|
||||||
def metadata():
|
def metadata():
|
||||||
print("placeholder")
|
print("placeholder")
|
||||||
|
|
||||||
|
|
||||||
def css():
|
def css():
|
||||||
print("placeholder")
|
print("placeholder")
|
||||||
|
|
||||||
|
@ -32,6 +30,7 @@ def main():
|
||||||
print("placeholder")
|
print("placeholder")
|
||||||
|
|
||||||
def test():
|
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()
|
test()
|
|
@ -8,7 +8,7 @@ class readMarkdown():
|
||||||
mdFile = ""
|
mdFile = ""
|
||||||
|
|
||||||
def __init__(self, mdFile):
|
def __init__(self, mdFile):
|
||||||
outStr = ""
|
self.outStr = ""
|
||||||
self.mdFile = mdFile
|
self.mdFile = mdFile
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,10 +17,13 @@ class readMarkdown():
|
||||||
|
|
||||||
file = open(mdFile, 'r')
|
file = open(mdFile, 'r')
|
||||||
#middleVar = file.read()
|
#middleVar = file.read()
|
||||||
outStr = str(markdown.markdown(file.read()))
|
self.outStr = str(markdown.markdown(file.read()))
|
||||||
|
file.close()
|
||||||
|
return(self.outStr)
|
||||||
|
|
||||||
|
|
||||||
def __str__(self):
|
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
|
# 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
|
# Edit: just keep the original markdown files dumbass
|
Loading…
Reference in New Issue