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