Mercurial > codedump
comparison generatehtml.py @ 108:d95fcf75275a
Update generatehtml.py
committer: GitHub <noreply@github.com>
author | Paper <37962225+mrpapersonic@users.noreply.github.com> |
---|---|
date | Wed, 26 Oct 2022 19:42:22 -0400 |
parents | 0477c50af5b0 |
children | cbf293a787d3 |
comparison
equal
deleted
inserted
replaced
107:96e5d721538f | 108:d95fcf75275a |
---|---|
1 # super simple | 1 # super simple |
2 | 2 |
3 import os | 3 import os |
4 import sys | 4 import sys |
5 import html | 5 import html |
6 import markdown | |
6 | 7 |
7 title = "Blog - Paper's website" | 8 title = "Blog - Paper's website" |
8 | 9 |
9 def addtitle(out_str, title): | 10 def addtitle(out_str, title): |
10 # add stuff here | 11 # add stuff here |
47 continue | 48 continue |
48 # this sucks. | 49 # this sucks. |
49 if lines[line][0:3] == "---": | 50 if lines[line][0:3] == "---": |
50 out_str += " </div>\n </div>\n" | 51 out_str += " </div>\n </div>\n" |
51 continue | 52 continue |
52 out_str += """%s\n""" % html.escape(lines[line].strip()) | 53 out_str += """%s\n""" % markdown.markdown(lines[line].strip()) |
53 out_str += "</body>" | 54 out_str += "</body>" |
54 print(out_str, file=out) | 55 print(out_str, file=out) |
55 | 56 |
56 if __name__ == "__main__": | 57 if __name__ == "__main__": |
57 main(sys.argv) | 58 main(sys.argv) |