aboutsummaryrefslogtreecommitdiffstats
path: root/doc/SConscript
blob: 6de280a16ebbd7ea1d5792be9385a0361cdd8018 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- 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(False, [])
    return sphinx.statuscode

env = Environment()
doc = env.Command(output, sources, build_doc)
env.Alias('doc', doc)