diff options
Diffstat (limited to 'admin')
-rwxr-xr-x | admin/build-doc | 23 | ||||
-rwxr-xr-x | admin/serve-doc | 29 |
2 files changed, 52 insertions, 0 deletions
diff --git a/admin/build-doc b/admin/build-doc new file mode 100755 index 00000000000..fd1afe5c365 --- /dev/null +++ b/admin/build-doc @@ -0,0 +1,23 @@ +#!/bin/sh +set -e +cd "$(dirname "$0")" +cd .. + +dia --filter=png-libart --export=doc/overview.png.tmp doc/overview.dia +mv -- doc/overview.png.tmp doc/overview.png + +install -d -m0755 build-doc +cd build-doc + +if [ ! -e virtualenv ]; then + virtualenv --no-site-packages virtualenv +fi +if [ ! -x virtualenv/bin/sphinx-build ]; then + ./virtualenv/bin/pip install sphinx +fi + +install -d -m0755 \ + output/html \ + output/man +./virtualenv/bin/sphinx-build -a -b dirhtml -d doctrees ../doc output/html +./virtualenv/bin/sphinx-build -a -b man -d doctrees ../doc output/man 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 |