modified: TODO

modified:   header.py
	modified:   main.py
This commit is contained in:
Amber 2022-03-04 22:35:57 -06:00
parent 04e9d83cdc
commit 11f6a2e38d
3 changed files with 38 additions and 5 deletions

2
TODO
View File

@ -3,4 +3,6 @@ Nice HTML tabs
Don't hard-code timezone Don't hard-code timezone
Build system Build system
Take input file as a command-line arguement Take input file as a command-line arguement
title, template, markdown
Figure out licencing Figure out licencing
Try to replace beautifulsoup

View File

@ -1,2 +1,29 @@
#!/usr/bin/python #!/usr/bin/python
import bs4
import datetime
def readHead():
inFile = ""
outHead = ""
time = []
sTitle = ""
footStr = "\n</body>\n</html>"
def __init__(self, headerFile, title):
self.inFile = headerFile
self.sTitle = title
self.outHead = ""
self.time = []
self.footStr = "\n</body>\n</html>"
def getTime(self):
gettime = datetime.datetime.now()
modDate = 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
createDate = self.modDate #TODO: make this seperate
global time
time.append(str(modDate))
time.append(str.createDate)

12
main.py
View File

@ -2,13 +2,14 @@
import readFile import readFile
import datetime import datetime
import header
#outFile = outFile + ".html" #outFile = outFile + ".html"
timeCreate = "" timeCreate = ""
timeMod = "" timeMod = ""
m2h = "" # markdown 2 html m2h = "" # markdown 2 html
headerStr = "" headerStr = ""
footStr = "\n</html>" footStr = "\n</body>\n</html>"
def printHtml(head, body, foot, outFile): def printHtml(head, body, foot, outFile):
@ -51,6 +52,7 @@ def metadata(inFile):
<meta name="changed" content=" """ <meta name="changed" content=" """
headerStr3 = """"/> headerStr3 = """"/>
</head> </head>
<body>
""" """
headerStr = headerStr + str(title) + headerStr1 + timeMod + headerStr2 + timeCreate + headerStr3 headerStr = headerStr + str(title) + headerStr1 + timeMod + headerStr2 + timeCreate + headerStr3
@ -70,8 +72,10 @@ def main():
def test(): def test():
#print(readFile.readMarkdown("/home/amber/website.sh/sample.md")) #print(readFile.readMarkdown("/home/amber/website.sh/sample.md"))
print(parseMd("sample.md")) #print(parseMd("sample.md"))
metadata("sample.md") #metadata("sample.md")
header.readHead("htmlTemplate/header.header.html", "string")
main() #main()
test()