Compare commits

...

No commits in common. "trunk" and "build" have entirely different histories.
trunk ... build

12 changed files with 0 additions and 255 deletions

6
.gitignore vendored
View File

@ -1,6 +0,0 @@
.git
workdir
outdir
indir
sample.md
__pycache__/

0
PKGBUILD Normal file
View File

8
TODO
View File

@ -1,8 +0,0 @@
Multiple template files
Nice HTML tabs
Don't hard-code timezone
Build system
Take input file as a command-line arguement, search multiple places for theme
title, template, markdown
Figure out licencing
#Try to replace beautifulsoup

View File

@ -1,43 +0,0 @@
/* CSS stolen from https://www.alm.website with permission */
body {
font-family: sans-serif;
}
code {
font-family: monospace;
background-color: #eee;
border-radius: 3px;
}
pre {
font-family: monospace;
background-color: #eee;
border-radius: 3px;
}
.align-left {
float: left;
}
.align-right {
float: right;
}
.align-center {
margin: auto;
width: 50%;
}
table, th, td {
border: solid 1px black;
border-collapse: collapse;
}
th, td {
margin: 2px;
}
/*nav {
speak: always;
}*/

View File

@ -1,28 +0,0 @@
/* Stolen from www.alm.website with permission */
nav {
display: flow;
border: solid 2px black;
margin: auto;
width: fit-content;
text-align: center;
justify-content: center;
white-space: nowrap;
}
nav li {
list-style: none;
border: solid 1px black;
margin: 2px;
}
nav h1 {
margin-top: 0;
margin-bottom: 0;
margin-right: 10px;
}
nav strong {
font-family: serif;
font-size: x-large;
}

View File

@ -1,39 +0,0 @@
#!/usr/bin/python
import datetime
import theme
class readHead():
#outHead = ""
sTime = []
sTitle = ""
sTheme = "basicTheme"
def __init__(self, sTitle, sTheme = "basicTheme"):
self.sTitle = sTitle
# self.outHead = ""
self.stime = []
self.sTheme = sTheme
def __str__(self):
return(str(self.genHead())) #TODO: Append CSS, navbar, sidebar, footer
# Start genHead()
def genHead(self):
# Generate html <head> element
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
headerStr = "<!DOCTYPE HTML>\n<html>\n<head>\n\t<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>\n\t<title>"
headerStr1 = "</title>\n\t<meta name=\"generator\" content=\"HTML.xonsh https://git.nixnet.services/amber/html.xonsh\"/>\n\t<meta name=\"created\" content=\""
headerStr2 = "\">\n\t<meta name=\"changed\" content=\""
headerStr3 = "\n</head>\n<body>\n\t"
outHead = headerStr + str(self.sTitle) + headerStr1 + timeMod + headerStr2 + timeCreate
#append css
outHead = outHead + "\">" + str(theme.css())
outHead = outHead + headerStr3
return(outHead)

View File

@ -1,12 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>TITLE</title>
<meta name="generator" content="BadGenerator"/>
<meta name="created" content="CREATEDATE"/>
<meta name="changed" content="MODDATE"/>
</head>
<body>
</body>
</html>

33
main.py
View File

@ -1,33 +0,0 @@
#!/usr/bin/python
import readFile
import datetime
import header
#outFile = outFile + ".html"
m2h = "" # markdown 2 html
footStr = "\n</body>\n</html>"
def printHtml(head, body, foot, outFile):
file = open(outFile, 'w')
file.write(str(head + body + foot))
file.close()
def parseMd(inFile):
global m2h
m2h = str(readFile.readMarkdown(inFile))
return(m2h)
def main():
# metadata("sample.md")
parseMd("sample.md")
humanReadableArg = str(header.readHead("Big Grand Tigle"))
printHtml(humanReadableArg, m2h, footStr, "outdir/index.html")
def test():
print(str(header.readHead("string")) + str(parseMd("sample.md")) + footStr)
main()
#test()

18
outline
View File

@ -1,18 +0,0 @@
Prompt for title
generate html headers
metadata
date, os, time, time modified
get from seperate file?
title from file name?
prompt for body; done
write navbar, sidebar with already-made files
edit navbar based on url
css
Stick it all together
write headers, side/navbars, body, and css
build script to make one binary

View File

@ -1,26 +0,0 @@
#!/usr/bin/python
import markdown
# Only do the <body> tag
class readMarkdown():
outStr = ""
mdFile = ""
def __init__(self, mdFile):
self.outStr = ""
self.mdFile = mdFile
def markdown(self):
file = open(self.mdFile, 'r')
outStr = str(markdown.markdown(file.read())) #TODO: I really want nice tab indentations
file.close()
return(outStr)
def __str__(self):
return(str(self.markdown()))
# might want to find a way to diff html from a file and readMarkdown()'s output if I want to update pages
# Edit: just keep the original markdown files dumbass

View File

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

View File

@ -1,40 +0,0 @@
#!/usr/bin/python
# Add argparse support, create themes
# Default theme will use the stuff I currently have on the home page
# TODO: don't hard-code theme, look into extensability
basic = {
"navCss": "css/navbar.css",
"bodyCss": "css/home.css",
"headerCss": "",
"footCss": ""
}
class css():
# sTheme = ""
def __init__(self, sTheme = basic):
self.sTheme = sTheme
def getTheme(self):
outStr = ""
for i in self.sTheme:
outStr = outStr + "\n\t<link rel=\"stylesheet\" href=\""
outStr = outStr + str(self.sTheme[i])
outStr = outStr + "\" media=\"\">"
return(outStr)
def __str__(self):
return(self.getTheme())
#def test(sTheme):
# outStr = ""
#
# for i in sTheme.values():
# print(str(i))
#test(basic)