aboutsummaryrefslogtreecommitdiffstats
path: root/doc/SConscript
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2010-02-16 14:53:25 +0100
committerOlivier Tilloy <olivier@tilloy.net>2010-02-16 14:53:25 +0100
commit314a33d945bc69c0a8cf72d3ec47e39d0d01e9bf (patch)
tree1d7480d05f5ed42038a20e1d6ed70cbffaa108cd /doc/SConscript
parent5654566f491370e413f619394a01397366cc3774 (diff)
downloadpyexiv2-314a33d945bc69c0a8cf72d3ec47e39d0d01e9bf.tar.gz
SConscript to build the HTML documentation using sphinx.
Diffstat (limited to 'doc/SConscript')
-rw-r--r--doc/SConscript28
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/SConscript b/doc/SConscript
new file mode 100644
index 0000000..aac5b70
--- /dev/null
+++ b/doc/SConscript
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+import inspect
+import os.path
+import sys
+from sphinx.application import Sphinx
+
+# Build HTML documentation using sphinx
+script = inspect.currentframe().f_code.co_filename
+srcdir = os.path.dirname(script)
+confdir = srcdir
+outdir = os.path.join(srcdir, '_build')
+doctreedir = os.path.join(outdir, '.doctrees')
+
+sphinx = Sphinx(srcdir, confdir, outdir, doctreedir, 'html', {}, sys.stdout)
+
+sources = [os.path.join(srcdir, doc + '.rst')
+ for doc in sphinx.builder.get_outdated_docs()]
+output = [os.path.join(outdir, doc + '.html')
+ for doc in sphinx.builder.get_outdated_docs()]
+
+def build_doc(target, source, env):
+ sphinx.build(all_files=False, filenames=[])
+ return sphinx.statuscode
+
+env = Environment()
+env.Command(output, sources, build_doc)