html.xonsh/main.py

49 lines
1.0 KiB
Python
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/python
import readFile
import datetime
outFile = ""
#outFile = outFile + ".html"
timeCreate = ""
timeMod = ""
m2h = "" # markdown 2 html
def printHtml(body):
print("placeholder")
file = open(outFile, 'w')
file.write(str(body))
file.close()
def parseMd(inFile):
m2h = readFile.readMarkdown(inFile)
return(m2h)
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 UTC06: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
def css():
print("placeholder")
def main():
print("placeholder")
def test():
#print(readFile.readMarkdown("/home/amber/website.sh/sample.md"))
print(parseMd("sample.md"))
metadata("sample.md")
test()