##// END OF EJS Templates
run darker
rushabh-v -
Show More
@@ -1,316 +1,316 b''
1 1 # -*- coding: utf-8 -*-
2 2 #
3 3 # IPython documentation build configuration file.
4 4
5 5 # NOTE: This file has been edited manually from the auto-generated one from
6 6 # sphinx. Do NOT delete and re-generate. If any changes from sphinx are
7 7 # needed, generate a scratch one and merge by hand any new fields needed.
8 8
9 9 #
10 10 # This file is execfile()d with the current directory set to its containing dir.
11 11 #
12 12 # The contents of this file are pickled, so don't put values in the namespace
13 13 # that aren't pickleable (module imports are okay, they're removed automatically).
14 14 #
15 15 # All configuration values have a default value; values that are commented out
16 16 # serve to show the default value.
17 17
18 18 import sys, os
19 19 from pathlib import Path
20 20
21 21 # http://read-the-docs.readthedocs.io/en/latest/faq.html
22 22 ON_RTD = os.environ.get('READTHEDOCS', None) == 'True'
23 23
24 24 if ON_RTD:
25 25 tags.add('rtd')
26 26
27 27 # RTD doesn't use the Makefile, so re-run autogen_{things}.py here.
28 for name in ('config', 'api', 'magics', 'shortcuts'):
29 fname = Path('autogen_{}.py'.format(name))
30 fpath = (Path(__file__).parent).joinpath('..', fname)
28 for name in ("config", "api", "magics", "shortcuts"):
29 fname = Path("autogen_{}.py".format(name))
30 fpath = (Path(__file__).parent).joinpath("..", fname)
31 31 with open(fpath) as f:
32 32 exec(compile(f.read(), fname, 'exec'), {
33 33 '__file__': fpath,
34 34 '__name__': '__main__',
35 35 })
36 36 else:
37 37 import sphinx_rtd_theme
38 38 html_theme = "sphinx_rtd_theme"
39 39 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
40 40
41 41 # If your extensions are in another directory, add it here. If the directory
42 42 # is relative to the documentation root, use os.path.abspath to make it
43 43 # absolute, like shown here.
44 44 sys.path.insert(0, os.path.abspath('../sphinxext'))
45 45
46 46 # We load the ipython release info into a dict by explicit execution
47 47 iprelease = {}
48 48 exec(compile(open('../../IPython/core/release.py').read(), '../../IPython/core/release.py', 'exec'),iprelease)
49 49
50 50 # General configuration
51 51 # ---------------------
52 52
53 53 # Add any Sphinx extension module names here, as strings. They can be extensions
54 54 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
55 55 extensions = [
56 56 'sphinx.ext.autodoc',
57 57 'sphinx.ext.autosummary',
58 58 'sphinx.ext.doctest',
59 59 'sphinx.ext.inheritance_diagram',
60 60 'sphinx.ext.intersphinx',
61 61 'sphinx.ext.graphviz',
62 62 'IPython.sphinxext.ipython_console_highlighting',
63 63 'IPython.sphinxext.ipython_directive',
64 64 'sphinx.ext.napoleon', # to preprocess docstrings
65 65 'github', # for easy GitHub links
66 66 'magics',
67 67 'configtraits',
68 68 ]
69 69
70 70 # Add any paths that contain templates here, relative to this directory.
71 71 templates_path = ['_templates']
72 72
73 73 # The suffix of source filenames.
74 74 source_suffix = '.rst'
75 75
76 76 rst_prolog = ''
77 77
78 78 def is_stable(extra):
79 79 for ext in {'dev', 'b', 'rc'}:
80 80 if ext in extra:
81 81 return False
82 82 return True
83 83
84 84 if is_stable(iprelease['_version_extra']):
85 85 tags.add('ipystable')
86 86 print('Adding Tag: ipystable')
87 87 else:
88 88 tags.add('ipydev')
89 89 print('Adding Tag: ipydev')
90 90 rst_prolog += """
91 91 .. warning::
92 92
93 93 This documentation covers a development version of IPython. The development
94 94 version may differ significantly from the latest stable release.
95 95 """
96 96
97 97 rst_prolog += """
98 98 .. important::
99 99
100 100 This documentation covers IPython versions 6.0 and higher. Beginning with
101 101 version 6.0, IPython stopped supporting compatibility with Python versions
102 102 lower than 3.3 including all versions of Python 2.7.
103 103
104 104 If you are looking for an IPython version compatible with Python 2.7,
105 105 please use the IPython 5.x LTS release and refer to its documentation (LTS
106 106 is the long term support release).
107 107
108 108 """
109 109
110 110 # The master toctree document.
111 111 master_doc = 'index'
112 112
113 113 # General substitutions.
114 114 project = 'IPython'
115 115 copyright = 'The IPython Development Team'
116 116
117 117 # ghissue config
118 118 github_project_url = "https://github.com/ipython/ipython"
119 119
120 120 # numpydoc config
121 121 numpydoc_show_class_members = False # Otherwise Sphinx emits thousands of warnings
122 122 numpydoc_class_members_toctree = False
123 123 warning_is_error = True
124 124
125 125 import logging
126 126
127 127 class ConfigtraitFilter(logging.Filter):
128 128 """
129 129 This is a filter to remove in sphinx 3+ the error about config traits being duplicated.
130 130
131 131 As we autogenerate configuration traits from, subclasses have lots of
132 132 duplication and we want to silence them. Indeed we build on travis with
133 133 warnings-as-error set to True, so those duplicate items make the build fail.
134 134 """
135 135
136 136 def filter(self, record):
137 137 if record.args and record.args[0] == 'configtrait' and 'duplicate' in record.msg:
138 138 return False
139 139 return True
140 140
141 141 ct_filter = ConfigtraitFilter()
142 142
143 143 import sphinx.util
144 144 logger = sphinx.util.logging.getLogger('sphinx.domains.std').logger
145 145
146 146 logger.addFilter(ct_filter)
147 147
148 148 # The default replacements for |version| and |release|, also used in various
149 149 # other places throughout the built documents.
150 150 #
151 151 # The full version, including alpha/beta/rc tags.
152 152 release = "%s" % iprelease['version']
153 153 # Just the X.Y.Z part, no '-dev'
154 154 version = iprelease['version'].split('-', 1)[0]
155 155
156 156
157 157 # There are two options for replacing |today|: either, you set today to some
158 158 # non-false value, then it is used:
159 159 #today = ''
160 160 # Else, today_fmt is used as the format for a strftime call.
161 161 today_fmt = '%B %d, %Y'
162 162
163 163 # List of documents that shouldn't be included in the build.
164 164 #unused_docs = []
165 165
166 166 # Exclude these glob-style patterns when looking for source files. They are
167 167 # relative to the source/ directory.
168 168 exclude_patterns = []
169 169
170 170
171 171 # If true, '()' will be appended to :func: etc. cross-reference text.
172 172 #add_function_parentheses = True
173 173
174 174 # If true, the current module name will be prepended to all description
175 175 # unit titles (such as .. function::).
176 176 #add_module_names = True
177 177
178 178 # If true, sectionauthor and moduleauthor directives will be shown in the
179 179 # output. They are ignored by default.
180 180 #show_authors = False
181 181
182 182 # The name of the Pygments (syntax highlighting) style to use.
183 183 pygments_style = 'sphinx'
184 184
185 185 # Set the default role so we can use `foo` instead of ``foo``
186 186 default_role = 'literal'
187 187
188 188 # Options for HTML output
189 189 # -----------------------
190 190
191 191 # The style sheet to use for HTML and HTML Help pages. A file of that name
192 192 # must exist either in Sphinx' static/ path, or in one of the custom paths
193 193 # given in html_static_path.
194 194 # html_style = 'default.css'
195 195
196 196
197 197 # The name for this set of Sphinx documents. If None, it defaults to
198 198 # "<project> v<release> documentation".
199 199 #html_title = None
200 200
201 201 # The name of an image file (within the static path) to place at the top of
202 202 # the sidebar.
203 203 #html_logo = None
204 204
205 205 # Add any paths that contain custom static files (such as style sheets) here,
206 206 # relative to this directory. They are copied after the builtin static files,
207 207 # so a file named "default.css" will overwrite the builtin "default.css".
208 208 html_static_path = ['_static']
209 209
210 210 # Favicon needs the directory name
211 211 html_favicon = '_static/favicon.ico'
212 212 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
213 213 # using the given strftime format.
214 214 html_last_updated_fmt = '%b %d, %Y'
215 215
216 216 # If true, SmartyPants will be used to convert quotes and dashes to
217 217 # typographically correct entities.
218 218 #html_use_smartypants = True
219 219
220 220 # Custom sidebar templates, maps document names to template names.
221 221 #html_sidebars = {}
222 222
223 223 # Additional templates that should be rendered to pages, maps page names to
224 224 # template names.
225 225 html_additional_pages = {
226 226 'interactive/htmlnotebook': 'notebook_redirect.html',
227 227 'interactive/notebook': 'notebook_redirect.html',
228 228 'interactive/nbconvert': 'notebook_redirect.html',
229 229 'interactive/public_server': 'notebook_redirect.html',
230 230 }
231 231
232 232 # If false, no module index is generated.
233 233 #html_use_modindex = True
234 234
235 235 # If true, the reST sources are included in the HTML build as _sources/<name>.
236 236 #html_copy_source = True
237 237
238 238 # If true, an OpenSearch description file will be output, and all pages will
239 239 # contain a <link> tag referring to it. The value of this option must be the
240 240 # base URL from which the finished HTML is served.
241 241 #html_use_opensearch = ''
242 242
243 243 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
244 244 #html_file_suffix = ''
245 245
246 246 # Output file base name for HTML help builder.
247 247 htmlhelp_basename = 'ipythondoc'
248 248
249 249 intersphinx_mapping = {'python': ('https://docs.python.org/3/', None),
250 250 'rpy2': ('https://rpy2.github.io/doc/latest/html/', None),
251 251 'jupyterclient': ('https://jupyter-client.readthedocs.io/en/latest/', None),
252 252 'jupyter': ('https://jupyter.readthedocs.io/en/latest/', None),
253 253 'jedi': ('https://jedi.readthedocs.io/en/latest/', None),
254 254 'traitlets': ('https://traitlets.readthedocs.io/en/latest/', None),
255 255 'ipykernel': ('https://ipykernel.readthedocs.io/en/latest/', None),
256 256 'prompt_toolkit' : ('https://python-prompt-toolkit.readthedocs.io/en/stable/', None),
257 257 'ipywidgets': ('https://ipywidgets.readthedocs.io/en/stable/', None),
258 258 'ipyparallel': ('https://ipyparallel.readthedocs.io/en/stable/', None),
259 259 'pip': ('https://pip.pypa.io/en/stable/', None)
260 260 }
261 261
262 262 # Options for LaTeX output
263 263 # ------------------------
264 264
265 265 # The font size ('10pt', '11pt' or '12pt').
266 266 latex_font_size = '11pt'
267 267
268 268 # Grouping the document tree into LaTeX files. List of tuples
269 269 # (source start file, target name, title, author, document class [howto/manual]).
270 270
271 271 latex_documents = [
272 272 ('index', 'ipython.tex', 'IPython Documentation',
273 273 u"""The IPython Development Team""", 'manual', True),
274 274 ('parallel/winhpc_index', 'winhpc_whitepaper.tex',
275 275 'Using IPython on Windows HPC Server 2008',
276 276 u"Brian E. Granger", 'manual', True)
277 277 ]
278 278
279 279 # The name of an image file (relative to this directory) to place at the top of
280 280 # the title page.
281 281 #latex_logo = None
282 282
283 283 # For "manual" documents, if this is true, then toplevel headings are parts,
284 284 # not chapters.
285 285 #latex_use_parts = False
286 286
287 287 # Additional stuff for the LaTeX preamble.
288 288 #latex_preamble = ''
289 289
290 290 # Documents to append as an appendix to all manuals.
291 291 #latex_appendices = []
292 292
293 293 # If false, no module index is generated.
294 294 latex_use_modindex = True
295 295
296 296
297 297 # Options for texinfo output
298 298 # --------------------------
299 299
300 300 texinfo_documents = [
301 301 (master_doc, 'ipython', 'IPython Documentation',
302 302 'The IPython Development Team',
303 303 'IPython',
304 304 'IPython Documentation',
305 305 'Programming',
306 306 1),
307 307 ]
308 308
309 309 modindex_common_prefix = ['IPython.']
310 310
311 311
312 312 # Cleanup
313 313 # -------
314 314 # delete release info to avoid pickling errors from sphinx
315 315
316 316 del iprelease
General Comments 0
You need to be logged in to leave comments. Login now