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