summaryrefslogtreecommitdiff
path: root/static.py
diff options
context:
space:
mode:
Diffstat (limited to 'static.py')
-rw-r--r--static.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/static.py b/static.py
new file mode 100644
index 0000000..3168843
--- /dev/null
+++ b/static.py
@@ -0,0 +1,13 @@
+import os, sys
+from bs4 import BeautifulSoup as bs4
+
+content_file = sys.argv[1]
+page_header = sys.argv[2] if len(sys.argv) > 2 else ''
+
+template = bs4(file('templates/static.html'), 'lxml')
+template.select('h2 small')[0].string = page_header
+template.find('div', {'id': 'content'}).append(
+ bs4(file(content_file).read(), 'lxml')
+)
+
+print template.prettify().encode('utf-8')