conf.py 7.46 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :

import os
import sys
import glob
import pkg_resources


# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
13
needs_sphinx = "1.3"
14
15
16
17

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
18
19
20
21
22
23
24
25
26
27
28
29
30
    "sphinx.ext.todo",
    "sphinx.ext.coverage",
    "sphinx.ext.ifconfig",
    "sphinx.ext.autodoc",
    "sphinx.ext.autosummary",
    "sphinx.ext.doctest",
    "sphinx.ext.graphviz",
    "sphinx.ext.intersphinx",
    "sphinx.ext.napoleon",
    "sphinx.ext.viewcode",
    "sphinx.ext.mathjax",
    "matplotlib.sphinxext.plot_directive",
]
31

32
# Be picky about warnings
33
nitpicky = False
34
35
36
37
38

# Ignores stuff we can't easily resolve on other project's sphinx manuals
nitpick_ignore = []

# Allows the user to override warnings from a separate file
39
40
if os.path.exists("nitpick-exceptions.txt"):
    for line in open("nitpick-exceptions.txt"):
41
42
43
44
        if line.strip() == "" or line.startswith("#"):
            continue
        dtype, target = line.split(None, 1)
        target = target.strip()
45
        try:  # python 2.x
46
47
48
49
50
            target = unicode(target)
        except NameError:
            pass
        nitpick_ignore.append((dtype, target))

51
52
53
# Always includes todos
todo_include_todos = True

Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
54
55
56
57
58
59
# Generates auto-summary automatically
autosummary_generate = True

# Create numbers on figures with captions
numfig = True

60
# If we are on OSX, the 'dvipng' path maybe different
61
62
63
dvipng_osx = "/opt/local/libexec/texlive/binaries/dvipng"
if os.path.exists(dvipng_osx):
    pngmath_dvipng = dvipng_osx
64
65

# Add any paths that contain templates here, relative to this directory.
66
templates_path = ["_templates"]
67
68

# The suffix of source filenames.
69
source_suffix = ".rst"
70
71

# The encoding of source files.
72
# source_encoding = 'utf-8-sig'
73
74

# The master toctree document.
75
master_doc = "index"
76
77

# General information about the project.
78
project = u"bob.bio.face"
79
import time
80
81

copyright = u"%s, Idiap Research Institute" % time.strftime("%Y")
82
83

# Grab the setup entry
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
84
distribution = pkg_resources.require(project)[0]
85
86
87
88
89
90
91
92
93
94
95
96

# 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.
#
# The short X.Y version.
version = distribution.version
# The full version, including alpha/beta/rc tags.
release = distribution.version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
97
# language = None
98
99
100

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
101
# today = ''
102
# Else, today_fmt is used as the format for a strftime call.
103
# today_fmt = '%B %d, %Y'
104
105
106

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
107
exclude_patterns = ["links.rst"]
108
109

# The reST default role (used for this markup: `text`) to use for all documents.
110
# default_role = None
111
112

# If true, '()' will be appended to :func: etc. cross-reference text.
113
# add_function_parentheses = True
114
115
116

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
117
# add_module_names = True
118
119
120

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
121
# show_authors = False
122
123

# The name of the Pygments (syntax highlighting) style to use.
124
pygments_style = "sphinx"
125
126

# A list of ignored prefixes for module index sorting.
127
# modindex_common_prefix = []
128

Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
129
# Some variables which are useful for generated material
130
131
132
project_variable = project.replace(".", "_")
short_description = u"Tools for running face recognition experiments"
owner = [u"Idiap Research Institute"]
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
133

134
135
136
137
138

# -- Options for HTML output ---------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
139
import sphinx_rtd_theme
140
141

html_theme = "sphinx_rtd_theme"
142
143
144
145

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
146
# html_theme_options = {}
147
148

# Add any paths that contain custom themes here, relative to this directory.
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
149
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
150
151
152

# The name for this set of Sphinx documents.  If None, it defaults to
# "<project> v<release> documentation".
153
# html_title = None
154
155

# A shorter title for the navigation bar.  Default is the same as html_title.
156
# html_short_title = project_variable
157
158
159

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
160
html_logo = "img/logo.png"
161
162
163
164

# The name of an image file (within the static path) to use as favicon of the
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
165
html_favicon = "img/favicon.ico"
166
167
168
169

# 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".
170
# html_static_path = ['_static']
171
172
173

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
174
# html_last_updated_fmt = '%b %d, %Y'
175
176
177

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
178
# html_use_smartypants = True
179
180

# Custom sidebar templates, maps document names to template names.
181
# html_sidebars = {}
182
183
184

# Additional templates that should be rendered to pages, maps page names to
# template names.
185
# html_additional_pages = {}
186
187

# If false, no module index is generated.
188
# html_domain_indices = True
189
190

# If false, no index is generated.
191
# html_use_index = True
192
193

# If true, the index is split into individual pages for each letter.
194
# html_split_index = False
195
196

# If true, links to the reST sources are added to the pages.
197
# html_show_sourcelink = True
198
199

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
200
# html_show_sphinx = True
201
202

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
203
# html_show_copyright = True
204
205
206
207

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it.  The value of this option must be the
# base URL from which the finished HTML is served.
208
# html_use_opensearch = ''
209
210

# This is the file name suffix for HTML files (e.g. ".xhtml").
211
# html_file_suffix = None
212
213

# Output file base name for HTML help builder.
214
htmlhelp_basename = project_variable + u"_doc"
215
216


Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
217
# -- Post configuration --------------------------------------------------------
218
219

# Included after all input documents
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
220
221
222
223
rst_epilog = """
.. |project| replace:: Bob
.. |version| replace:: %s
.. |current-year| date:: %%Y
224
225
226
""" % (
    version,
)
227
228

# Default processing flags for sphinx
229
230
autoclass_content = "class"
autodoc_member_order = "bysource"
231
autodoc_default_options = {
232
233
234
    "members": True,
    "undoc-members": True,
    "show-inheritance": True,
235
}
236
237

# For inter-documentation mapping:
238
from bob.extension.utils import link_documentation, load_requirements
239

240
sphinx_requirements = "extra-intersphinx.txt"
241
if os.path.exists(sphinx_requirements):
242
243
244
    intersphinx_mapping = link_documentation(
        additional_packages=["python", "numpy"] + load_requirements(sphinx_requirements)
    )
245
else:
246
    intersphinx_mapping = link_documentation()