summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR. Tyler Ballance <tyler@slide.com>2009-04-05 20:15:28 -0700
committerR. Tyler Ballance <tyler@slide.com>2009-04-05 20:15:28 -0700
commit85f1e2b1d88967ef48957c82991839399cee2eb1 (patch)
tree620f4e49e304935f975826de80d7c1074a1a3c58
parentbc86c9d528452128459b70948f53c4459bc358b5 (diff)
downloadpython-cheetah-85f1e2b1d88967ef48957c82991839399cee2eb1.tar.gz
Add the buildwiki and runwiki scripts, still toying around with the concept of using Cheetah for this
Signed-off-by: R. Tyler Ballance <tyler@slide.com>
-rw-r--r--Home.tmpl6
-rw-r--r--WikiRoot.tmpl1
-rw-r--r--buildwiki.py20
-rw-r--r--runwiki.py17
4 files changed, 42 insertions, 2 deletions
diff --git a/Home.tmpl b/Home.tmpl
index 6ca2554..b066cb1 100644
--- a/Home.tmpl
+++ b/Home.tmpl
@@ -6,5 +6,9 @@
#end def
#def content()
- #return ''
+Welcome to the Community Cheetah Wiki
+-------------------------------------
+
+This page was generated via the Cheetah.Filter.Markdown class and the Home.tmpl template
+in the "wiki" branch.
#end def
diff --git a/WikiRoot.tmpl b/WikiRoot.tmpl
index d9ad9b3..019516b 100644
--- a/WikiRoot.tmpl
+++ b/WikiRoot.tmpl
@@ -16,7 +16,6 @@ $content()
$footer()
-
</body></html>
#def pagename()
diff --git a/buildwiki.py b/buildwiki.py
new file mode 100644
index 0000000..69b0110
--- /dev/null
+++ b/buildwiki.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+import sys
+import os
+
+def main():
+ print '==> Generating Python files'
+ files = os.listdir('.')
+ for file in files:
+ if file.endswith('.tmpl'):
+ os.system('cheetah compile %s' % file)
+ print '==> Generating HTML files'
+ for file in files:
+ if file.endswith('.tmpl'):
+ os.system('python %(file)s.py > %(file)s.html' % {'file' : file[:-5]})
+ return 0
+
+if __name__ == '__main__':
+ rc = main()
+ sys.exit(rc)
diff --git a/runwiki.py b/runwiki.py
new file mode 100644
index 0000000..c86a745
--- /dev/null
+++ b/runwiki.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+
+import sys
+import os
+import SimpleHTTPServer
+
+def main():
+ print '==> Starting wiki server on port 8000'
+ try:
+ SimpleHTTPServer.test()
+ except KeyboardInterrupt:
+ print '===> Exiting..'
+ return 0
+
+if __name__ == '__main__':
+ rc = main()
+ sys.exit(rc)