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-03 00:41:53 +00:00
|
|
|
|
|
|
|
|
|
outFile = ""
|
2022-03-03 02:00:20 +00:00
|
|
|
|
#outFile = outFile + ".html"
|
2022-03-03 04:57:39 +00:00
|
|
|
|
timeCreate = ""
|
|
|
|
|
timeMod = ""
|
2022-03-03 03:59:46 +00:00
|
|
|
|
m2h = "" # markdown 2 html
|
2022-03-03 00:41:53 +00:00
|
|
|
|
|
|
|
|
|
|
2022-03-03 03:59:46 +00:00
|
|
|
|
def printHtml(body):
|
2022-03-03 00:41:53 +00:00
|
|
|
|
print("placeholder")
|
2022-03-03 02:00:20 +00:00
|
|
|
|
file = open(outFile, 'w')
|
2022-03-03 03:59:46 +00:00
|
|
|
|
file.write(str(body))
|
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):
|
|
|
|
|
m2h = readFile.readMarkdown(inFile)
|
|
|
|
|
return(m2h)
|
2022-03-03 00:41:53 +00:00
|
|
|
|
|
2022-03-03 04:57:39 +00:00
|
|
|
|
def metadata(inFile):
|
|
|
|
|
# Read metadata from possible file
|
|
|
|
|
## Pretend there's code here
|
|
|
|
|
|
|
|
|
|
# Generate metadata
|
|
|
|
|
getTime = datetime.datetime.now()
|
|
|
|
|
timeMod = str(getTime.strftime("%A, %B %d, %Y at %X UTC−06:00")) #TODO: I don't want to hard-code this but the %z utc offset isn't printing
|
|
|
|
|
timeCreate = timeMod
|
|
|
|
|
|
|
|
|
|
title = inFile.split(".")
|
|
|
|
|
title = str(title[0]) #TODO: figure out a way to make longer titles without putting spaces in the filename
|
|
|
|
|
|
2022-03-03 00:41:53 +00:00
|
|
|
|
|
|
|
|
|
def css():
|
|
|
|
|
print("placeholder")
|
|
|
|
|
|
|
|
|
|
def main():
|
2022-03-03 02:40:58 +00:00
|
|
|
|
print("placeholder")
|
|
|
|
|
|
|
|
|
|
def test():
|
2022-03-03 03:59:46 +00:00
|
|
|
|
#print(readFile.readMarkdown("/home/amber/website.sh/sample.md"))
|
|
|
|
|
print(parseMd("sample.md"))
|
2022-03-03 02:40:58 +00:00
|
|
|
|
|
2022-03-03 04:57:39 +00:00
|
|
|
|
metadata("sample.md")
|
|
|
|
|
|
2022-03-03 03:59:46 +00:00
|
|
|
|
test()
|