summaryrefslogtreecommitdiffstats
path: root/Utilities/Sphinx/conf.py.in
blob: ea00b7855bd3b65e0dfe37c5f05e72bfc6f0a827 (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2013 Kitware, Inc., Insight Software Consortium
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
import sys
import os
import re
import glob

sys.path.insert(0, r'@conf_path@')

source_suffix = '.rst'
master_doc = 'index'
project = 'CMake'
copyright = '@conf_copyright@'

version = '@conf_version@' # feature version
release = '@conf_release@' # full version string

primary_domain = 'cmake'

exclude_patterns = []

extensions = ['cmake']

cmake_manuals = sorted(glob.glob(r'@conf_docs@/manual/*.rst'))
cmake_manual_description = re.compile('^\.\. cmake-manual-description:(.*)$')
man_pages = []
for fpath in cmake_manuals:
    try:
        name, sec, rst = os.path.basename(fpath).split('.')
        desc = None
        f = open(fpath, 'r')
        for l in f:
            m = cmake_manual_description.match(l)
            if m:
                desc = m.group(1).strip()
                break
        f.close()
        if desc:
            man_pages.append(('manual/%s.%s' % (name, sec),
                              name, desc, [], int(sec)))
        else:
            sys.stderr.write("ERROR: No cmake-manual-description in '%s'\n" % fpath)
    except Exception, e:
        sys.stderr.write("ERROR: %s\n" % str(e))
man_show_urls = False

html_show_sourcelink = True
html_static_path = ['@conf_path@/static']
html_style = 'cmake.css'