| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# /*########################################################################## |
| 3 |
# Copyright (C) 2015-2017 European Synchrotron Radiation Facility |
| 4 |
# |
| 5 |
# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 |
# of this software and associated documentation files (the "Software"), to deal |
| 7 |
# in the Software without restriction, including without limitation the rights |
| 8 |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 9 |
# copies of the Software, and to permit persons to whom the Software is |
| 10 |
# furnished to do so, subject to the following conditions: |
| 11 |
# |
| 12 |
# The above copyright notice and this permission notice shall be included in |
| 13 |
# all copies or substantial portions of the Software. |
| 14 |
# |
| 15 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 |
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 21 |
# THE SOFTWARE. |
| 22 |
# |
| 23 |
# ############################################################################*/ |
| 24 |
"""freesas documentation build configuration file, created by |
| 25 |
sphinx-quickstart on Fri Nov 27 14:20:46 2015. |
| 26 |
|
| 27 |
This file is execfile()d with the current directory set to its containing dir. |
| 28 |
|
| 29 |
Note that not all possible configuration values are present in this |
| 30 |
autogenerated file. |
| 31 |
|
| 32 |
All configuration values have a default; values that are commented out |
| 33 |
serve to show the default.""" |
| 34 |
|
| 35 |
import sys |
| 36 |
import os |
| 37 |
import os.path |
| 38 |
import glob |
| 39 |
import subprocess |
| 40 |
|
| 41 |
# If extensions (or modules to document with autodoc) are in another directory, |
| 42 |
# add these directories to sys.path here. If the directory is relative to the |
| 43 |
# documentation root, use os.path.abspath to make it absolute, like shown here. |
| 44 |
# sys.path.insert(0, os.path.abspath('.')) |
| 45 |
|
| 46 |
on_rtd = os.environ.get('READTHEDOCS') == 'True' |
| 47 |
|
| 48 |
project = u'freesas' |
| 49 |
try: |
| 50 |
import freesas |
| 51 |
project_dir = os.path.abspath(os.path.join(__file__, "..", "..", "..")) |
| 52 |
build_dir = os.path.abspath(freesas.__file__) |
| 53 |
if on_rtd: |
| 54 |
print("On Read The Docs") |
| 55 |
print("build_dir", build_dir) |
| 56 |
print("project_dir", project_dir) |
| 57 |
elif not build_dir.startswith(project_dir): |
| 58 |
raise RuntimeError( |
| 59 |
"%s looks to come from the system. Fix your PYTHONPATH and restart sphinx." |
| 60 |
% project |
| 61 |
) |
| 62 |
except ImportError: |
| 63 |
raise RuntimeError( |
| 64 |
"%s is not on the path. Fix your PYTHONPATH and restart sphinx." % project |
| 65 |
) |
| 66 |
|
| 67 |
# Disable deprecation warnings: |
| 68 |
# It avoid to spam documentation logs with deprecation warnings. |
| 69 |
# If we want to generate the documentation of deprecated features it should |
| 70 |
# not make the logs durty. |
| 71 |
from silx.utils.deprecation import depreclog |
| 72 |
depreclog.disabled = 1 |
| 73 |
|
| 74 |
# Add local sphinx extension directory |
| 75 |
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ext')) |
| 76 |
|
| 77 |
# -- General configuration ----------------------------------------------------- |
| 78 |
|
| 79 |
# If your documentation needs a minimal Sphinx version, state it here. |
| 80 |
# needs_sphinx = '1.0' |
| 81 |
|
| 82 |
# Add any Sphinx extension module names here, as strings. They can be extensions |
| 83 |
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
| 84 |
|
| 85 |
import sphinx |
| 86 |
|
| 87 |
try: |
| 88 |
import sphinx.ext.mathjax |
| 89 |
except: |
| 90 |
print("Not using math extension for sphinx") |
| 91 |
sys.path.append(os.path.dirname(os.path.abspath(__file__))) |
| 92 |
import mathjax |
| 93 |
import sphinx.ext |
| 94 |
|
| 95 |
sphinx.ext.mathjax = mathjax |
| 96 |
sys.modules["sphinx.ext.mathjax"] = mathjax |
| 97 |
|
| 98 |
extensions = [ |
| 99 |
'sphinx.ext.autodoc', |
| 100 |
'sphinx.ext.coverage', |
| 101 |
'sphinx.ext.mathjax', |
| 102 |
'sphinx.ext.viewcode', |
| 103 |
'sphinx.ext.doctest', |
| 104 |
# 'sphinxext-archive', |
| 105 |
'sphinxcontrib.programoutput', |
| 106 |
'nbsphinx' |
| 107 |
|
| 108 |
] |
| 109 |
|
| 110 |
if sphinx.__version__ < "1.4": |
| 111 |
extensions.append('sphinx.ext.pngmath') |
| 112 |
|
| 113 |
# Set the theme to sphinx_rtd_theme when *not* building on Read The Docs. |
| 114 |
# The theme is set to default otherwise as Read The Docs uses its own theme anyway. |
| 115 |
if not on_rtd: |
| 116 |
import sphinx_rtd_theme |
| 117 |
|
| 118 |
extensions.append('sphinx_rtd_theme') |
| 119 |
|
| 120 |
autodoc_member_order = 'bysource' |
| 121 |
|
| 122 |
# Add any paths that contain templates here, relative to this directory. |
| 123 |
templates_path = ['_templates'] |
| 124 |
|
| 125 |
# The suffix of source filenames. |
| 126 |
source_suffix = '.rst' |
| 127 |
|
| 128 |
# The encoding of source files. |
| 129 |
# source_encoding = 'utf-8-sig' |
| 130 |
|
| 131 |
# The master toctree document. |
| 132 |
master_doc = 'index' |
| 133 |
|
| 134 |
# General information about the project. |
| 135 |
from freesas import strictversion, version, date as _date |
| 136 |
year = _date.split("/")[-1] |
| 137 |
copyright = u'2015-%s, Data analysis unit, European Synchrotron Radiation Facility, Grenoble' % year |
| 138 |
|
| 139 |
# The version info for the project you're documenting, acts as replacement for |
| 140 |
# |version| and |release|, also used in various other places throughout the |
| 141 |
# built documents. |
| 142 |
# |
| 143 |
# The short X.Y version. |
| 144 |
# version = '0.0.1' |
| 145 |
# The full version, including alpha/beta/rc tags. |
| 146 |
release = strictversion |
| 147 |
|
| 148 |
# The language for content autogenerated by Sphinx. Refer to documentation |
| 149 |
# for a list of supported languages. |
| 150 |
# language = None |
| 151 |
|
| 152 |
# There are two options for replacing |today|: either, you set today to some |
| 153 |
# non-false value, then it is used: |
| 154 |
# today = '' |
| 155 |
# Else, today_fmt is used as the format for a strftime call. |
| 156 |
# today_fmt = '%B %d, %Y' |
| 157 |
|
| 158 |
# List of patterns, relative to source directory, that match files and |
| 159 |
# directories to ignore when looking for source files. |
| 160 |
exclude_patterns = [] |
| 161 |
|
| 162 |
# The reST default role (used for this markup: `text`) to use for all documents. |
| 163 |
# default_role = None |
| 164 |
|
| 165 |
# If true, '()' will be appended to :func: etc. cross-reference text. |
| 166 |
# add_function_parentheses = True |
| 167 |
|
| 168 |
# If true, the current module name will be prepended to all description |
| 169 |
# unit titles (such as .. function::). |
| 170 |
add_module_names = False |
| 171 |
|
| 172 |
# If true, sectionauthor and moduleauthor directives will be shown in the |
| 173 |
# output. They are ignored by default. |
| 174 |
# show_authors = False |
| 175 |
|
| 176 |
# The name of the Pygments (syntax highlighting) style to use. |
| 177 |
pygments_style = 'sphinx' |
| 178 |
|
| 179 |
# A list of ignored prefixes for module index sorting. |
| 180 |
# modindex_common_prefix = [] |
| 181 |
|
| 182 |
# If true, keep warnings as "system message" paragraphs in the built documents. |
| 183 |
# keep_warnings = False |
| 184 |
|
| 185 |
# -- Options for HTML output --------------------------------------------------- |
| 186 |
|
| 187 |
# The theme to use for HTML and HTML Help pages. See the documentation for |
| 188 |
# a list of builtin themes. |
| 189 |
html_theme = 'default' if on_rtd else 'sphinx_rtd_theme' |
| 190 |
|
| 191 |
# Theme options are theme-specific and customize the look and feel of a theme |
| 192 |
# further. For a list of options available for each theme, see the |
| 193 |
# documentation. |
| 194 |
# html_theme_options = {} |
| 195 |
|
| 196 |
# Add any paths that contain custom themes here, relative to this directory. |
| 197 |
# html_theme_path = [] |
| 198 |
|
| 199 |
# The name for this set of Sphinx documents. If None, it defaults to |
| 200 |
# "<project> v<release> documentation". |
| 201 |
# html_title = None |
| 202 |
|
| 203 |
# A shorter title for the navigation bar. Default is the same as html_title. |
| 204 |
# html_short_title = None |
| 205 |
|
| 206 |
# The name of an image file (relative to this directory) to place at the top |
| 207 |
# of the sidebar. |
| 208 |
html_logo = "img/image.png" |
| 209 |
|
| 210 |
# The name of an image file (within the static path) to use as favicon of the |
| 211 |
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
| 212 |
# pixels large. |
| 213 |
# html_favicon = None |
| 214 |
|
| 215 |
# Add any paths that contain custom static files (such as style sheets) here, |
| 216 |
# relative to this directory. They are copied after the builtin static files, |
| 217 |
# so a file named "default.css" will overwrite the builtin "default.css". |
| 218 |
# html_static_path = [] |
| 219 |
|
| 220 |
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
| 221 |
# using the given strftime format. |
| 222 |
# html_last_updated_fmt = '%b %d, %Y' |
| 223 |
|
| 224 |
# If true, SmartyPants will be used to convert quotes and dashes to |
| 225 |
# typographically correct entities. |
| 226 |
# html_use_smartypants = True |
| 227 |
|
| 228 |
# Custom sidebar templates, maps document names to template names. |
| 229 |
# html_sidebars = {} |
| 230 |
|
| 231 |
# Additional templates that should be rendered to pages, maps page names to |
| 232 |
# template names. |
| 233 |
# html_additional_pages = {} |
| 234 |
|
| 235 |
# If false, no module index is generated. |
| 236 |
# html_domain_indices = True |
| 237 |
|
| 238 |
# If false, no index is generated. |
| 239 |
# html_use_index = True |
| 240 |
|
| 241 |
# If true, the index is split into individual pages for each letter. |
| 242 |
# html_split_index = False |
| 243 |
|
| 244 |
# If true, links to the reST sources are added to the pages. |
| 245 |
# html_show_sourcelink = True |
| 246 |
|
| 247 |
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. |
| 248 |
# html_show_sphinx = True |
| 249 |
|
| 250 |
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. |
| 251 |
# html_show_copyright = True |
| 252 |
|
| 253 |
# If true, an OpenSearch description file will be output, and all pages will |
| 254 |
# contain a <link> tag referring to it. The value of this option must be the |
| 255 |
# base URL from which the finished HTML is served. |
| 256 |
# html_use_opensearch = '' |
| 257 |
|
| 258 |
# This is the file name suffix for HTML files (e.g. ".xhtml"). |
| 259 |
# html_file_suffix = None |
| 260 |
|
| 261 |
# Output file base name for HTML help builder. |
| 262 |
htmlhelp_basename = 'FreeSASdoc' |
| 263 |
|
| 264 |
# -- Options for LaTeX output --------------------------------------------- |
| 265 |
|
| 266 |
latex_elements = {'papersize': 'a4paper', |
| 267 |
'pointsize': '10pt'} |
| 268 |
|
| 269 |
# Grouping the document tree into LaTeX files. List of tuples |
| 270 |
# (source start file, target name, title, author, documentclass [howto/manual]). |
| 271 |
latex_documents = [ |
| 272 |
('FreeSAS', 'FreeSAS.tex', u'FreeSAS Documentation', |
| 273 |
u'Guillaume Bonamis', 'manual'), |
| 274 |
] |
| 275 |
|
| 276 |
# The name of an image file (relative to this directory) to place at the top of |
| 277 |
# the title page. |
| 278 |
# latex_logo = None |
| 279 |
|
| 280 |
# For "manual" documents, if this is true, then toplevel headings are parts, |
| 281 |
# not chapters. |
| 282 |
# latex_use_parts = False |
| 283 |
|
| 284 |
# If true, show page references after internal links. |
| 285 |
# latex_show_pagerefs = False |
| 286 |
|
| 287 |
# If true, show URL addresses after external links. |
| 288 |
# latex_show_urls = False |
| 289 |
|
| 290 |
# Documents to append as an appendix to all manuals. |
| 291 |
# latex_appendices = [] |
| 292 |
|
| 293 |
# If false, no module index is generated. |
| 294 |
# latex_domain_indices = True |
| 295 |
|
| 296 |
# -- Options for manual page output --------------------------------------- |
| 297 |
|
| 298 |
# One entry per manual page. List of tuples |
| 299 |
# (source start file, name, description, authors, manual section). |
| 300 |
man_pages = [ |
| 301 |
('index', 'freesas', u'FreeSAS Documentation', |
| 302 |
[u'Guillaume Bonamis'], 1) |
| 303 |
] |
| 304 |
|
| 305 |
# If true, show URL addresses after external links. |
| 306 |
# man_show_urls = False |
| 307 |
|
| 308 |
# -- Options for Texinfo output ------------------------------------------- |
| 309 |
|
| 310 |
# Grouping the document tree into Texinfo files. List of tuples |
| 311 |
# (source start file, target name, title, author, |
| 312 |
# dir menu entry, description, category) |
| 313 |
texinfo_documents = [ |
| 314 |
('index', 'FreeSAS', u'FreeSAS Documentation', |
| 315 |
u'Guillaume Bonamis', 'FreeSAS', 'One line description of project.', |
| 316 |
'Miscellaneous'), |
| 317 |
] |
| 318 |
|
| 319 |
# Documents to append as an appendix to all manuals. |
| 320 |
# texinfo_appendices = [] |
| 321 |
|
| 322 |
# If false, no module index is generated. |
| 323 |
# texinfo_domain_indices = True |
| 324 |
|
| 325 |
# How to display URL addresses: 'footnote', 'no', or 'inline'. |
| 326 |
# texinfo_show_urls = 'footnote' |
| 327 |
|
| 328 |
# Do not test code in >>> by default |
| 329 |
doctest_test_doctest_blocks = '' |