conf.py.in 2.52 KB
Newer Older
1 2 3
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

4
import sys
5 6 7
import os
import re
import glob
8 9 10 11 12 13

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

source_suffix = '.rst'
master_doc = 'index'

14
project = 'CMake'
15
copyright = '@conf_copyright@'
16 17
version = '@conf_version@' # feature version
release = '@conf_release@' # full version string
18
pygments_style = 'colors.CMakeTemplateStyle'
19 20

primary_domain = 'cmake'
21
highlight_language = 'none'
22

23 24 25
exclude_patterns = [
    'dev', # ignore developer-only documentation
    ]
26 27

extensions = ['cmake']
28
templates_path = ['@conf_path@/templates']
29

30 31
nitpicky = True

32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
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)
51
    except Exception as e:
52
        sys.stderr.write("ERROR: %s\n" % str(e))
53 54 55 56 57
man_show_urls = False

html_show_sourcelink = True
html_static_path = ['@conf_path@/static']
html_style = 'cmake.css'
58
html_theme = 'default'
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
html_theme_options = {
    'footerbgcolor':    '#00182d',
    'footertextcolor':  '#ffffff',
    'sidebarbgcolor':   '#e4ece8',
    'sidebarbtncolor':  '#00a94f',
    'sidebartextcolor': '#333333',
    'sidebarlinkcolor': '#00a94f',
    'relbarbgcolor':    '#00529b',
    'relbartextcolor':  '#ffffff',
    'relbarlinkcolor':  '#ffffff',
    'bgcolor':          '#ffffff',
    'textcolor':        '#444444',
    'headbgcolor':      '#f2f2f2',
    'headtextcolor':    '#003564',
    'headlinkcolor':    '#3d8ff2',
    'linkcolor':        '#2b63a8',
    'visitedlinkcolor': '#2b63a8',
    'codebgcolor':      '#eeeeee',
    'codetextcolor':    '#333333',
}
79 80
html_title = 'CMake %s Documentation' % release
html_short_title = '%s Documentation' % release
81
html_favicon = '@conf_path@/static/cmake-favicon.ico'
82 83 84 85
# Not supported yet by sphinx:
# https://bitbucket.org/birkenfeld/sphinx/issue/1448/make-qthelp-more-configurable
# qthelp_namespace = "org.cmake"
# qthelp_qch_name = "CMake-300.qch"