Updated TODO, started working on metadata.

This commit is contained in:
Amber 2022-03-02 22:57:39 -06:00
parent a5850ba2ec
commit 85ed6f60a1
4 changed files with 23 additions and 7 deletions

5
TODO
View File

@ -1,2 +1,5 @@
Multiple template files
Nice HTML tabs
Don't hard-code timezone
Build system
Take input file as a command-line arguement

21
main.py
View File

@ -1,11 +1,12 @@
#!/usr/bin/python
import readFile
import datetime
outFile = ""
#outFile = outFile + ".html"
timeCreate = 0 #Do I want this to be a str?
timeMod = 0
timeCreate = ""
timeMod = ""
m2h = "" # markdown 2 html
@ -20,8 +21,18 @@ def parseMd(inFile):
m2h = readFile.readMarkdown(inFile)
return(m2h)
def metadata():
print("placeholder")
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")
@ -33,4 +44,6 @@ def test():
#print(readFile.readMarkdown("/home/amber/website.sh/sample.md"))
print(parseMd("sample.md"))
metadata("sample.md")
test()

View File

@ -17,7 +17,7 @@ class readMarkdown():
file = open(mdFile, 'r')
#middleVar = file.read()
self.outStr = str(markdown.markdown(file.read()))
self.outStr = str(markdown.markdown(file.read())) #TODO: I really want nice tab indentations
file.close()
return(self.outStr)

View File

@ -1,2 +1,2 @@
python
python-markdown
python-markdown https://python-markdown.github.io/