Statistics
| Branch: | Revision:

iof-tools / networkxMiCe / networkx-master / doc / conf.py @ 5cef0f13

History | View | Annotate | Download (6.87 KB)

1
# -*- coding: utf-8 -*-
2
#
3
# Sphinx documentation build configuration file, created by
4
# sphinx-quickstart.py on Sat Mar  8 21:47:50 2008.
5
#
6
# This file is execfile()d with the current directory set to its containing dir.
7
#
8
# The contents of this file are pickled, so don't put values in the namespace
9
# that aren't pickleable (module imports are okay, they're removed automatically).
10
#
11
# All configuration values have a default value; values that are commented out
12
# serve to show the default value.
13
from __future__ import print_function
14

    
15
import sys
16
import os
17
from datetime import date
18

    
19
from sphinx_gallery.sorting import ExplicitOrder
20

    
21
# Check Sphinx version
22
import sphinx
23
if sphinx.__version__ < "1.3":
24
    raise RuntimeError("Sphinx 1.3 or newer required")
25

    
26
# Environment variable to know if the docs are being built on rtd.
27
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
28
#print
29
#print("Building on ReadTheDocs: {}".format(on_rtd))
30
#print
31
#print("Current working directory: {}".format(os.path.abspath(os.curdir)))
32
#print("Python: {}".format(sys.executable))
33

    
34
# If your extensions are in another directory, add it here.
35
# These locations are relative to conf.py
36

    
37
# General configuration
38
# ---------------------
39

    
40
# Add any Sphinx extension module names here, as strings. They can be extensions
41
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
42
extensions = [
43
    'sphinx.ext.autosummary',
44
    'sphinx.ext.autodoc',
45
    'sphinx.ext.coverage',
46
    'sphinx.ext.doctest',
47
    'sphinx.ext.intersphinx',
48
    'sphinx.ext.mathjax',
49
    'sphinx.ext.napoleon',
50
    'sphinx.ext.todo',
51
    'sphinx.ext.viewcode',
52
    'sphinx_gallery.gen_gallery',
53
    'nb2plots',
54
    'texext',
55
]
56

    
57
# https://github.com/sphinx-gallery/sphinx-gallery
58
sphinx_gallery_conf = {
59
    # path to your examples scripts
60
    'examples_dirs': '../examples',
61
    'subsection_order': ExplicitOrder(['../examples/basic',
62
                                       '../examples/drawing',
63
                                       '../examples/graph',
64
                                       '../examples/algorithms',
65
                                       '../examples/advanced',
66
                                       '../examples/3d_drawing',
67
                                       '../examples/pygraphviz',
68
                                       '../examples/javascript',
69
                                       '../examples/jit',
70
                                       '../examples/applications',
71
                                       '../examples/subclass']),
72
    # path where to save gallery generated examples
73
    'gallery_dirs': 'auto_examples',
74
    'backreferences_dir': 'modules/generated',
75
    'expected_failing_examples': ['../examples/advanced/plot_parallel_betweenness.py']
76
}
77

    
78
# generate autosummary pages
79
autosummary_generate = True
80

    
81
# Add any paths that contain templates here, relative to this directory.
82
#templates_path = ['']
83

    
84
suppress_warnings = ['ref.citation', 'ref.footnote']
85

    
86
# The suffix of source filenames.
87
source_suffix = '.rst'
88

    
89
# The encoding of source files.
90
source_encoding = 'utf-8'
91

    
92
# The master toctree document.
93
master_doc = 'index'
94

    
95
# General substitutions.
96
project = 'NetworkX'
97
copyright = '2004-{}, NetworkX Developers'.format(date.today().year)
98

    
99
# The default replacements for |version| and |release|, also used in various
100
# other places throughout the built documents.
101
#
102
# The short X.Y version.
103
import networkx
104
version = networkx.__version__
105
# The full version, including dev info
106
release = networkx.__version__.replace('_', '')
107

    
108
# There are two options for replacing |today|: either, you set today to some
109
# non-false value, then it is used:
110
#today = ''
111
# Else, today_fmt is used as the format for a strftime call.
112
#today_fmt = '%B %d, %Y'
113

    
114
# List of documents that shouldn't be included in the build.
115
# unused_docs = ['']
116

    
117
# If true, '()' will be appended to :func: etc. cross-reference text.
118
#add_function_parentheses = True
119

    
120
# If true, the current module name will be prepended to all description
121
# unit titles (such as .. function::).
122
add_module_names = False
123

    
124
# show_authors = True
125

    
126
# The name of the Pygments (syntax highlighting) style to use.
127
#pygments_style = 'friendly'
128
pygments_style = 'sphinx'
129

    
130
# A list of prefixs that are ignored when creating the module index. (new in Sphinx 0.6)
131
modindex_common_prefix = ['networkx.']
132

    
133
doctest_global_setup = "import networkx as nx"
134

    
135
# treat ``x, y : type`` as vars x and y instead of default ``y(x,) : type``
136
napoleon_use_param = False
137

    
138
# Options for HTML output
139
# -----------------------
140

    
141
if not on_rtd:
142
    import sphinx_rtd_theme
143
    html_theme = 'sphinx_rtd_theme'
144
    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
145

    
146
# html_theme_options = {
147
#    "rightsidebar": "true",
148
#    "relbarbgcolor: "black"
149
#}
150

    
151
# The style sheet to use for HTML and HTML Help pages. A file of that name
152
# must exist either in Sphinx' static/ path, or in one of the custom paths
153
# given in html_static_path.
154
#html_style = ''
155

    
156
# Add any paths that contain custom static files (such as style sheets) here,
157
# relative to this directory. They are copied after the builtin static files,
158
# so a file named "default.css" will overwrite the builtin "default.css".
159
html_static_path = ['_static']
160

    
161
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
162
# using the given strftime format.
163
html_last_updated_fmt = '%b %d, %Y'
164

    
165
# If true, SmartyPants will be used to convert quotes and dashes to
166
# typographically correct entities.
167
#html_use_smartypants = True
168

    
169
# Content template for the index page.
170
#html_index = 'index.html'
171

    
172
# Custom sidebar templates, maps page names to templates.
173
#html_sidebars = {}
174

    
175
# Additional templates that should be rendered to pages, maps page names to
176
# templates.
177
#html_additional_pages = {'': ''}
178

    
179
# If true, the reST sources are included in the HTML build as _sources/<name>.
180
html_copy_source = False
181

    
182
html_use_opensearch = 'http://networkx.github.io'
183

    
184
# Output file base name for HTML help builder.
185
htmlhelp_basename = 'NetworkX'
186

    
187
# Options for LaTeX output
188
# ------------------------
189

    
190
# The paper size ('letter' or 'a4').
191
latex_paper_size = 'letter'
192

    
193
# The font size ('10pt', '11pt' or '12pt').
194
#latex_font_size = '10pt'
195

    
196
# Grouping the document tree into LaTeX files. List of tuples
197
# (source start file, target name, title, author, document class [howto/manual]).
198
latex_documents = [('reference/index', 'networkx_reference.tex',
199
                    'NetworkX Reference',
200
                    'Aric Hagberg, Dan Schult, Pieter Swart', 'manual', 1)]
201

    
202
latex_appendices = ['tutorial']
203

    
204
# Intersphinx mapping
205
intersphinx_mapping = {'https://docs.python.org/2/': None,
206
                       'https://docs.scipy.org/doc/numpy/': None,
207
                       }
208

    
209
# The reST default role (used for this markup: `text`) to use for all
210
# documents.
211
default_role = 'obj'
212

    
213
numpydoc_show_class_members = False
214

    
215
# Add the 'copybutton' javascript, to hide/show the prompt in code
216
# examples
217
def setup(app):
218
    app.add_javascript('copybutton.js')