2022-03-02 05:32:31 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
2022-03-03 02:00:20 +00:00
|
|
|
import readFile
|
2022-03-03 04:57:39 +00:00
|
|
|
import datetime
|
2022-03-05 04:35:57 +00:00
|
|
|
import header
|
2022-03-03 00:41:53 +00:00
|
|
|
|
2022-03-03 02:00:20 +00:00
|
|
|
#outFile = outFile + ".html"
|
2022-03-03 03:59:46 +00:00
|
|
|
m2h = "" # markdown 2 html
|
2022-03-05 04:35:57 +00:00
|
|
|
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 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 main():
|
2022-03-05 07:04:26 +00:00
|
|
|
# metadata("sample.md")
|
2022-03-04 02:40:32 +00:00
|
|
|
parseMd("sample.md")
|
2022-03-09 03:39:44 +00:00
|
|
|
humanReadableArg = str(header.readHead("Big Grand Tigle"))
|
|
|
|
printHtml(humanReadableArg, m2h, footStr, "outdir/index.html")
|
2022-03-04 02:40:32 +00:00
|
|
|
|
2022-03-03 02:40:58 +00:00
|
|
|
def test():
|
2022-03-09 01:48:18 +00:00
|
|
|
print(str(header.readHead("string")) + str(parseMd("sample.md")) + footStr)
|
2022-03-03 04:57:39 +00:00
|
|
|
|
2022-03-09 03:39:44 +00:00
|
|
|
main()
|
|
|
|
#test()
|