html.xonsh/main.py

40 lines
728 B
Python
Raw Normal View History

#!/usr/bin/python
2022-03-03 02:00:20 +00:00
import readFile
import datetime
import header
2022-03-03 00:41:53 +00:00
2022-03-03 02:00:20 +00:00
#outFile = outFile + ".html"
timeCreate = ""
timeMod = ""
2022-03-03 03:59:46 +00:00
m2h = "" # markdown 2 html
2022-03-04 02:40:32 +00:00
headerStr = ""
footStr = "\n</body>\n</html>"
2022-03-03 00:41:53 +00:00
2022-03-04 02:40:32 +00:00
def printHtml(head, body, foot, outFile):
2022-03-03 00:41:53 +00:00
print("placeholder")
2022-03-03 02:00:20 +00:00
file = open(outFile, 'w')
2022-03-04 02:40:32 +00:00
file.write(str(head + body + foot))
2022-03-03 02:00:20 +00:00
2022-03-03 03:59:46 +00:00
file.close()
2022-03-03 00:41:53 +00:00
2022-03-03 03:59:46 +00:00
def parseMd(inFile):
2022-03-04 02:40:32 +00:00
global m2h
m2h = str(readFile.readMarkdown(inFile))
2022-03-03 03:59:46 +00:00
return(m2h)
2022-03-03 00:41:53 +00:00
def css():
print("placeholder")
def main():
2022-03-05 07:04:26 +00:00
# metadata("sample.md")
2022-03-04 02:40:32 +00:00
parseMd("sample.md")
printHtml(headerStr, m2h, footStr, "outdir/index.html")
2022-03-03 02:40:58 +00:00
def test():
print(str(header.readHead("string")) + str(parseMd("sample.md")) + footStr)
#main()
2022-03-05 07:04:26 +00:00
test()