]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Serve sphinx docs from app engine
authorBen Darnell <ben@bendarnell.com>
Sat, 11 Jun 2011 22:09:05 +0000 (15:09 -0700)
committerBen Darnell <ben@bendarnell.com>
Sat, 11 Jun 2011 22:09:05 +0000 (15:09 -0700)
website/app.yaml
website/templates/documentation.html [deleted file]
website/templates/overview.html [new file with mode: 0644]
website/templates/overview.txt [moved from website/templates/documentation.txt with 100% similarity]
website/website.py

index 109663ba5a4da729a840207ebf220051b2f36367..d0ee858a30a910e631f00d8773449316005553f3 100644 (file)
@@ -1,5 +1,5 @@
 application: python-tornado
-version: 1
+version: 2
 runtime: python
 api_version: 1
 
@@ -21,5 +21,11 @@ handlers:
   static_files: static/favicon.ico
   upload: static/favicon.ico
 
+- url: /documentation/reference/
+  script: website.py
+
+- url: /documentation/reference
+  static_dir: sphinx/build/html
+
 - url: /.*
   script: website.py
diff --git a/website/templates/documentation.html b/website/templates/documentation.html
deleted file mode 100644 (file)
index 8c28740..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "base.html" %}
-
-{% block title %}Tornado Web Server Documentation{% end %}
-
-{% block headertitle %}<h1>documentation</h1>{% end %}
-
-{% block body %}
-  {{ markdown("documentation.txt", toc=True) }}
-{% end %}
diff --git a/website/templates/overview.html b/website/templates/overview.html
new file mode 100644 (file)
index 0000000..bcaa022
--- /dev/null
@@ -0,0 +1,9 @@
+{% extends "base.html" %}
+
+{% block title %}Tornado Web Server Overview{% end %}
+
+{% block headertitle %}<h1>overview</h1>{% end %}
+
+{% block body %}
+  {{ markdown("overview.txt", toc=True) }}
+{% end %}
index 39b7aed4cace05d1248c8dadb5d52762ebe845e0..32ec68493fc5e091fb6f0565d8b8b89cfe9f7ce6 100644 (file)
@@ -24,9 +24,8 @@ import wsgiref.handlers
 
 
 class ContentHandler(tornado.web.RequestHandler):
-    def get(self, path):
-        paths = ("documentation", "index")
-        if not path: path = "index"
+    def get(self, path="index"):
+        paths = ("overview", "index")
         if path not in paths:
             raise tornado.web.HTTPError(404)
         self.render(path + ".html", markdown=self.markdown)
@@ -51,12 +50,19 @@ settings = {
     "debug": os.environ.get("SERVER_SOFTWARE", "").startswith("Development/"),
 }
 application = tornado.wsgi.WSGIApplication([
-    (r"/([a-z]*)", ContentHandler),
+    (r"/", ContentHandler),
+    (r"/(index)", ContentHandler),
+    (r"/documentation/(overview)", ContentHandler),
     (r"/static/tornado-0.1.tar.gz", tornado.web.RedirectHandler,
      dict(url="http://github.com/downloads/facebook/tornado/tornado-0.1.tar.gz")),
     (r"/static/tornado-0.2.tar.gz", tornado.web.RedirectHandler,
      dict(url="http://github.com/downloads/facebook/tornado/tornado-0.2.tar.gz")),
 
+    (r"/documentation/?", tornado.web.RedirectHandler,
+     dict(url="/documentation/overview")),
+    (r"/documentation/reference/?", tornado.web.RedirectHandler,
+     dict(url="/documentation/reference/index.html")),
+
 ], **settings)