parent
04e9d83cdc
commit
11f6a2e38d
2
TODO
2
TODO
|
@ -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
|
27
header.py
27
header.py
|
@ -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 UTC−06: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
12
main.py
|
@ -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()
|
Loading…
Reference in New Issue