/
conf.py.in
195 lines (154 loc) · 7.18 KB
/
conf.py.in
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# -*- mode: python -*-
# -*- coding: utf-8 -*-
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
import sphinx_bootstrap_theme # checked at cmake time
# mantid must be importable
try:
import mantid
except ImportError:
sys.exit("Cannot import mantid module. Check Python path.")
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, '@CMAKE_CURRENT_SOURCE_DIR@/sphinxext')
# -- General configuration ------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
# we use pngmath over mathjax so that the the offline help isn't reliant on
# anything external and we don't need to include the large mathjax package
'sphinx.ext.pngmath',
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.doctest',
'mantiddoc.directives',
'mantiddoc.autodoc',
'mantiddoc.doctest'
]
#try: # bonus for doxygen links - TODO off for now
# import sphinxcontrib.doxylink
# extensions.append('sphinxcontrib.doxylink')
#except ImportError:
# pass
#try: # bonus for breathe - TODO off for now
# import breathe
# extensions.append('breathe')
#except ImportError:
# pass
# Add any paths that contain templates here, relative to this directory.
templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/source/_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'MantidProject'
copyright = u'2015, Mantid'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
version_str = mantid.__version__
# The short X.Y version.
version = ".".join(version_str.split(".")[:2])
# The full version, including alpha/beta/rc tags.
release = version_str
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# -- Options for doctest --------------------------------------------------
# Run this before each test is executed
doctest_global_setup = """
from mantid.simpleapi import *
# doctest.py examines the global scope for future imports
# and uses the sames ones in the executing scope. We don't want the
# Python-3 style behaviour in the docs yet.
try:
del print_function
del absolute_import
del division
del unicode_literals
except NameError:
pass
"""
# Run this after each test group has executed
doctest_global_cleanup = """
from mantid.api import FrameworkManager
from mantid.kernel import ConfigService
FrameworkManager.Instance().clear()
ConfigService.Instance().reset()
"""
# -- Options for pngmath --------------------------------------------------
# Load the preview package into latex
pngmath_latex_preamble=r'\usepackage[active]{preview}'
# Ensures that the vertical alignment of equations is correct.
# See http://sphinx-doc.org/ext/math.html#confval-pngmath_use_preview
pngmath_use_preview = True
# -- Options for sphinxcontrib-doxylink output ---------------------------------
# Need to figure out best way to get at the build directory. It would be nice
# if we didn't have to make this a file generated by CMake
#doxylink = { 'mantidcpp' : ('@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/../Framework/Doxygen/Mantid.tag',
# 'http://doxygen.mantidproject.org/') }
# -- Options for breathe output ------------------------------------------------
#breathe_projects = {
# "mantid" : "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/../doxygen/xml/"
#}
#breathe_default_project = "mantid"
# -- Common options HTML output --------------------------------------------
# May be overridden in a conf-BUILDER.py file
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'bootstrap'
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
# The "title" for HTML documentation generated with Sphinx' templates. This is appended to the <title> tag of individual pages
# and used in the navigation bar as the "topmost" element.
html_title = ""
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = os.path.relpath('@CMAKE_CURRENT_SOURCE_DIR@/../images/Mantid_Logo_Transparent.png')
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/source/_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
html_use_smartypants = True
# Hide the Sphinx usage as we reference it on github instead.
html_show_sphinx = False
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
html_show_copyright = False
# -- Options for Epub output ---------------------------------------------------
# This flag determines if a toc entry is inserted again at the beginning of its nested toc listing.
# This allows easier navigation to the top of a chapter, but can be confusing because it mixes entries of different depth in one list.
# The default value is True.
epub_tocdup = True
#This setting control the scope of the epub table of contents
epub_tocscope = 'includehidden'
#The author of the document. This is put in the Dublin Core metadata. The default value is 'unknown'.
epub_author = "The Mantid Project"
#The publisher of the document. This is put in the Dublin Core metadata. You may use any sensible string, e.g. the project homepage.
epub_publisher = "The Mantid Project"
#An identifier for the document. This is put in the Dublin Core metadata.
#For published documents this is the ISBN number, but you can also use an alternative scheme, e.g. the project homepage.
#The default value is 'unknown'.
epub_identifier = "www.mantidproject.org"
#The publication scheme for the epub_identifier. This is put in the Dublin Core metadata.
#For published books the scheme is 'ISBN'. If you use the project homepage, 'URL' seems reasonable.
#The default value is 'unknown'.
epub_scheme='URL'
#A unique identifier for the document. This is put in the Dublin Core metadata. You may use a random string.
#The default value is 'unknown'.
epub_uid = "Mantid Reference: " + version
# -- Options for selected builder output ---------------------------------------
# Place in a separate file for clarity
builder_options_file = "@CMAKE_CURRENT_SOURCE_DIR@/conf-@BUILDER@.py"
if os.path.exists(builder_options_file):
exec(compile(open(builder_options_file).read(), builder_options_file, 'exec'))