Updated TODO, started working on metadata.
This commit is contained in:
		
							parent
							
								
									a5850ba2ec
								
							
						
					
					
						commit
						85ed6f60a1
					
				
							
								
								
									
										5
									
								
								TODO
								
								
								
								
							
							
						
						
									
										5
									
								
								TODO
								
								
								
								
							| 
						 | 
					@ -1,2 +1,5 @@
 | 
				
			||||||
Multiple template files
 | 
					Multiple template files
 | 
				
			||||||
 | 
					Nice HTML tabs
 | 
				
			||||||
 | 
					Don't hard-code timezone
 | 
				
			||||||
 | 
					Build system
 | 
				
			||||||
 | 
					Take input file as a command-line arguement
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										21
									
								
								main.py
								
								
								
								
							
							
						
						
									
										21
									
								
								main.py
								
								
								
								
							| 
						 | 
					@ -1,11 +1,12 @@
 | 
				
			||||||
#!/usr/bin/python
 | 
					#!/usr/bin/python
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import readFile
 | 
					import readFile
 | 
				
			||||||
 | 
					import datetime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
outFile = ""
 | 
					outFile = ""
 | 
				
			||||||
#outFile = outFile + ".html"
 | 
					#outFile = outFile + ".html"
 | 
				
			||||||
timeCreate = 0 #Do I want this to be a str?
 | 
					timeCreate = "" 
 | 
				
			||||||
timeMod = 0
 | 
					timeMod = ""
 | 
				
			||||||
m2h = "" # markdown 2 html
 | 
					m2h = "" # markdown 2 html
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,8 +21,18 @@ def parseMd(inFile):
 | 
				
			||||||
    m2h = readFile.readMarkdown(inFile)
 | 
					    m2h = readFile.readMarkdown(inFile)
 | 
				
			||||||
    return(m2h)
 | 
					    return(m2h)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def metadata():
 | 
					def metadata(inFile):
 | 
				
			||||||
    print("placeholder")
 | 
					    # 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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def css():
 | 
					def css():
 | 
				
			||||||
    print("placeholder")
 | 
					    print("placeholder")
 | 
				
			||||||
| 
						 | 
					@ -33,4 +44,6 @@ 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")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test()
 | 
					test()
 | 
				
			||||||
| 
						 | 
					@ -17,7 +17,7 @@ class readMarkdown():
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        file = open(mdFile, 'r')
 | 
					        file = open(mdFile, 'r')
 | 
				
			||||||
        #middleVar = file.read()
 | 
					        #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()
 | 
					        file.close()
 | 
				
			||||||
        return(self.outStr)
 | 
					        return(self.outStr)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,2 +1,2 @@
 | 
				
			||||||
python
 | 
					python
 | 
				
			||||||
python-markdown
 | 
					python-markdown https://python-markdown.github.io/
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue