diff options
author | Tommi Virtanen <tommi.virtanen@dreamhost.com> | 2011-08-19 16:43:21 -0700 |
---|---|---|
committer | Tommi Virtanen <tommi.virtanen@dreamhost.com> | 2011-08-29 17:27:14 -0700 |
commit | f1d89644998e227319fcafb44f0f3a17df502f5a (patch) | |
tree | bdec177fb6b0e226770e1fabca3ff402ec4c6f94 /admin/serve-doc | |
parent | 68f57f9afbc0b17e3050345260884980b8a6cb48 (diff) | |
download | ceph-f1d89644998e227319fcafb44f0f3a17df502f5a.tar.gz |
First draft of the documentation overhaul.
To build the docs, run ./admin/build-doc. To browse them, either get
them on any static website, or just run ./admin/serve-doc to serve
them quickly off of port 8080.
build-doc sets up a virtualenv to avoid needing Sphinx installed
system-wide. serve-doc needs thttpd installed.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
Diffstat (limited to 'admin/serve-doc')
-rwxr-xr-x | admin/serve-doc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/admin/serve-doc b/admin/serve-doc new file mode 100755 index 00000000000..9c1bfb44c79 --- /dev/null +++ b/admin/serve-doc @@ -0,0 +1,29 @@ +#!/usr/bin/python +import SimpleHTTPServer +import SocketServer +import os +import sys + +path = os.path.dirname(sys.argv[0]) +os.chdir(path) +os.chdir('..') +os.chdir('build-doc/output/html') + +class ReusingTCPServer(SimpleHTTPServer.SimpleHTTPRequestHandler): + allow_reuse_address = True + + def send_head(self): + # horrible kludge because SimpleHTTPServer is buggy wrt + # slash-redirecting of requests with query arguments, and will + # redirect to /foo?q=bar/ -- wrong slash placement + self.path = self.path.split('?', 1)[0] + return SimpleHTTPServer.SimpleHTTPRequestHandler.send_head(self) + +httpd = SocketServer.TCPServer( + ("", 8080), + ReusingTCPServer, + ) +try: + httpd.serve_forever() +except KeyboardInterrupt: + pass |