##// END OF EJS Templates
py3compat: execfile in sphinx conf.py
Min RK -
Show More
@@ -1,253 +1,253 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
19
20 ON_RTD = os.environ.get('READTHEDOCS', None) == 'True'
20 ON_RTD = os.environ.get('READTHEDOCS', None) == 'True'
21
21
22 if ON_RTD:
22 if ON_RTD:
23 # Mock the presence of matplotlib, which we don't have on RTD
23 # Mock the presence of matplotlib, which we don't have on RTD
24 # see
24 # see
25 # http://read-the-docs.readthedocs.org/en/latest/faq.html
25 # http://read-the-docs.readthedocs.org/en/latest/faq.html
26 tags.add('rtd')
26 tags.add('rtd')
27
27
28 # If your extensions are in another directory, add it here. If the directory
28 # If your extensions are in another directory, add it here. If the directory
29 # is relative to the documentation root, use os.path.abspath to make it
29 # is relative to the documentation root, use os.path.abspath to make it
30 # absolute, like shown here.
30 # absolute, like shown here.
31 sys.path.insert(0, os.path.abspath('../sphinxext'))
31 sys.path.insert(0, os.path.abspath('../sphinxext'))
32
32
33 # We load the ipython release info into a dict by explicit execution
33 # We load the ipython release info into a dict by explicit execution
34 iprelease = {}
34 iprelease = {}
35 execfile('../../IPython/core/release.py',iprelease)
35 exec(compile(open('../../IPython/core/release.py').read(), '../../IPython/core/release.py', 'exec'),iprelease)
36
36
37 # General configuration
37 # General configuration
38 # ---------------------
38 # ---------------------
39
39
40 # Add any Sphinx extension module names here, as strings. They can be extensions
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.
41 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
42 extensions = [
42 extensions = [
43 'matplotlib.sphinxext.mathmpl',
43 'matplotlib.sphinxext.mathmpl',
44 'matplotlib.sphinxext.only_directives',
44 'matplotlib.sphinxext.only_directives',
45 'matplotlib.sphinxext.plot_directive',
45 'matplotlib.sphinxext.plot_directive',
46 'sphinx.ext.autodoc',
46 'sphinx.ext.autodoc',
47 'sphinx.ext.autosummary',
47 'sphinx.ext.autosummary',
48 'sphinx.ext.doctest',
48 'sphinx.ext.doctest',
49 'sphinx.ext.inheritance_diagram',
49 'sphinx.ext.inheritance_diagram',
50 'sphinx.ext.intersphinx',
50 'sphinx.ext.intersphinx',
51 'IPython.sphinxext.ipython_console_highlighting',
51 'IPython.sphinxext.ipython_console_highlighting',
52 'IPython.sphinxext.ipython_directive',
52 'IPython.sphinxext.ipython_directive',
53 'numpydoc', # to preprocess docstrings
53 'numpydoc', # to preprocess docstrings
54 'github', # for easy GitHub links
54 'github', # for easy GitHub links
55 'magics',
55 'magics',
56 ]
56 ]
57
57
58 if ON_RTD:
58 if ON_RTD:
59 # Remove extensions not currently supported on RTD
59 # Remove extensions not currently supported on RTD
60 extensions.remove('matplotlib.sphinxext.only_directives')
60 extensions.remove('matplotlib.sphinxext.only_directives')
61 extensions.remove('matplotlib.sphinxext.mathmpl')
61 extensions.remove('matplotlib.sphinxext.mathmpl')
62 extensions.remove('matplotlib.sphinxext.plot_directive')
62 extensions.remove('matplotlib.sphinxext.plot_directive')
63 extensions.remove('IPython.sphinxext.ipython_directive')
63 extensions.remove('IPython.sphinxext.ipython_directive')
64 extensions.remove('IPython.sphinxext.ipython_console_highlighting')
64 extensions.remove('IPython.sphinxext.ipython_console_highlighting')
65
65
66 # Add any paths that contain templates here, relative to this directory.
66 # Add any paths that contain templates here, relative to this directory.
67 templates_path = ['_templates']
67 templates_path = ['_templates']
68
68
69 # The suffix of source filenames.
69 # The suffix of source filenames.
70 source_suffix = '.rst'
70 source_suffix = '.rst'
71
71
72 if iprelease['_version_extra'] == 'dev':
72 if iprelease['_version_extra'] == 'dev':
73 rst_prolog = """
73 rst_prolog = """
74 .. note::
74 .. note::
75
75
76 This documentation is for a development version of IPython. There may be
76 This documentation is for a development version of IPython. There may be
77 significant differences from the latest stable release.
77 significant differences from the latest stable release.
78
78
79 """
79 """
80
80
81 # The master toctree document.
81 # The master toctree document.
82 master_doc = 'index'
82 master_doc = 'index'
83
83
84 # General substitutions.
84 # General substitutions.
85 project = 'IPython'
85 project = 'IPython'
86 copyright = 'The IPython Development Team'
86 copyright = 'The IPython Development Team'
87
87
88 # ghissue config
88 # ghissue config
89 github_project_url = "https://github.com/ipython/ipython"
89 github_project_url = "https://github.com/ipython/ipython"
90
90
91 # numpydoc config
91 # numpydoc config
92 numpydoc_show_class_members = False # Otherwise Sphinx emits thousands of warnings
92 numpydoc_show_class_members = False # Otherwise Sphinx emits thousands of warnings
93 numpydoc_class_members_toctree = False
93 numpydoc_class_members_toctree = False
94
94
95 # The default replacements for |version| and |release|, also used in various
95 # The default replacements for |version| and |release|, also used in various
96 # other places throughout the built documents.
96 # other places throughout the built documents.
97 #
97 #
98 # The full version, including alpha/beta/rc tags.
98 # The full version, including alpha/beta/rc tags.
99 release = "%s" % iprelease['version']
99 release = "%s" % iprelease['version']
100 # Just the X.Y.Z part, no '-dev'
100 # Just the X.Y.Z part, no '-dev'
101 version = iprelease['version'].split('-', 1)[0]
101 version = iprelease['version'].split('-', 1)[0]
102
102
103
103
104 # There are two options for replacing |today|: either, you set today to some
104 # There are two options for replacing |today|: either, you set today to some
105 # non-false value, then it is used:
105 # non-false value, then it is used:
106 #today = ''
106 #today = ''
107 # Else, today_fmt is used as the format for a strftime call.
107 # Else, today_fmt is used as the format for a strftime call.
108 today_fmt = '%B %d, %Y'
108 today_fmt = '%B %d, %Y'
109
109
110 # List of documents that shouldn't be included in the build.
110 # List of documents that shouldn't be included in the build.
111 #unused_docs = []
111 #unused_docs = []
112
112
113 # Exclude these glob-style patterns when looking for source files. They are
113 # Exclude these glob-style patterns when looking for source files. They are
114 # relative to the source/ directory.
114 # relative to the source/ directory.
115 exclude_patterns = ['whatsnew/pr']
115 exclude_patterns = ['whatsnew/pr']
116
116
117
117
118 # If true, '()' will be appended to :func: etc. cross-reference text.
118 # If true, '()' will be appended to :func: etc. cross-reference text.
119 #add_function_parentheses = True
119 #add_function_parentheses = True
120
120
121 # If true, the current module name will be prepended to all description
121 # If true, the current module name will be prepended to all description
122 # unit titles (such as .. function::).
122 # unit titles (such as .. function::).
123 #add_module_names = True
123 #add_module_names = True
124
124
125 # If true, sectionauthor and moduleauthor directives will be shown in the
125 # If true, sectionauthor and moduleauthor directives will be shown in the
126 # output. They are ignored by default.
126 # output. They are ignored by default.
127 #show_authors = False
127 #show_authors = False
128
128
129 # The name of the Pygments (syntax highlighting) style to use.
129 # The name of the Pygments (syntax highlighting) style to use.
130 pygments_style = 'sphinx'
130 pygments_style = 'sphinx'
131
131
132 # Set the default role so we can use `foo` instead of ``foo``
132 # Set the default role so we can use `foo` instead of ``foo``
133 default_role = 'literal'
133 default_role = 'literal'
134
134
135 # Options for HTML output
135 # Options for HTML output
136 # -----------------------
136 # -----------------------
137
137
138 # The style sheet to use for HTML and HTML Help pages. A file of that name
138 # The style sheet to use for HTML and HTML Help pages. A file of that name
139 # must exist either in Sphinx' static/ path, or in one of the custom paths
139 # must exist either in Sphinx' static/ path, or in one of the custom paths
140 # given in html_static_path.
140 # given in html_static_path.
141 html_style = 'default.css'
141 html_style = 'default.css'
142
142
143 # The name for this set of Sphinx documents. If None, it defaults to
143 # The name for this set of Sphinx documents. If None, it defaults to
144 # "<project> v<release> documentation".
144 # "<project> v<release> documentation".
145 #html_title = None
145 #html_title = None
146
146
147 # The name of an image file (within the static path) to place at the top of
147 # The name of an image file (within the static path) to place at the top of
148 # the sidebar.
148 # the sidebar.
149 #html_logo = None
149 #html_logo = None
150
150
151 # Add any paths that contain custom static files (such as style sheets) here,
151 # Add any paths that contain custom static files (such as style sheets) here,
152 # relative to this directory. They are copied after the builtin static files,
152 # relative to this directory. They are copied after the builtin static files,
153 # so a file named "default.css" will overwrite the builtin "default.css".
153 # so a file named "default.css" will overwrite the builtin "default.css".
154 html_static_path = ['_static']
154 html_static_path = ['_static']
155
155
156 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
156 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
157 # using the given strftime format.
157 # using the given strftime format.
158 html_last_updated_fmt = '%b %d, %Y'
158 html_last_updated_fmt = '%b %d, %Y'
159
159
160 # If true, SmartyPants will be used to convert quotes and dashes to
160 # If true, SmartyPants will be used to convert quotes and dashes to
161 # typographically correct entities.
161 # typographically correct entities.
162 #html_use_smartypants = True
162 #html_use_smartypants = True
163
163
164 # Custom sidebar templates, maps document names to template names.
164 # Custom sidebar templates, maps document names to template names.
165 #html_sidebars = {}
165 #html_sidebars = {}
166
166
167 # Additional templates that should be rendered to pages, maps page names to
167 # Additional templates that should be rendered to pages, maps page names to
168 # template names.
168 # template names.
169 html_additional_pages = {
169 html_additional_pages = {
170 'interactive/htmlnotebook': 'notebook_redirect.html',
170 'interactive/htmlnotebook': 'notebook_redirect.html',
171 'interactive/notebook': 'notebook_redirect.html',
171 'interactive/notebook': 'notebook_redirect.html',
172 'interactive/nbconvert': 'notebook_redirect.html',
172 'interactive/nbconvert': 'notebook_redirect.html',
173 'interactive/public_server': 'notebook_redirect.html',
173 'interactive/public_server': 'notebook_redirect.html',
174 }
174 }
175
175
176 # If false, no module index is generated.
176 # If false, no module index is generated.
177 #html_use_modindex = True
177 #html_use_modindex = True
178
178
179 # If true, the reST sources are included in the HTML build as _sources/<name>.
179 # If true, the reST sources are included in the HTML build as _sources/<name>.
180 #html_copy_source = True
180 #html_copy_source = True
181
181
182 # If true, an OpenSearch description file will be output, and all pages will
182 # If true, an OpenSearch description file will be output, and all pages will
183 # contain a <link> tag referring to it. The value of this option must be the
183 # contain a <link> tag referring to it. The value of this option must be the
184 # base URL from which the finished HTML is served.
184 # base URL from which the finished HTML is served.
185 #html_use_opensearch = ''
185 #html_use_opensearch = ''
186
186
187 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
187 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
188 #html_file_suffix = ''
188 #html_file_suffix = ''
189
189
190 # Output file base name for HTML help builder.
190 # Output file base name for HTML help builder.
191 htmlhelp_basename = 'ipythondoc'
191 htmlhelp_basename = 'ipythondoc'
192
192
193 intersphinx_mapping = {'python': ('http://docs.python.org/2/', None),
193 intersphinx_mapping = {'python': ('http://docs.python.org/2/', None),
194 'rpy2': ('http://rpy.sourceforge.net/rpy2/doc-2.4/html/', None)}
194 'rpy2': ('http://rpy.sourceforge.net/rpy2/doc-2.4/html/', None)}
195
195
196 # Options for LaTeX output
196 # Options for LaTeX output
197 # ------------------------
197 # ------------------------
198
198
199 # The paper size ('letter' or 'a4').
199 # The paper size ('letter' or 'a4').
200 latex_paper_size = 'letter'
200 latex_paper_size = 'letter'
201
201
202 # The font size ('10pt', '11pt' or '12pt').
202 # The font size ('10pt', '11pt' or '12pt').
203 latex_font_size = '11pt'
203 latex_font_size = '11pt'
204
204
205 # Grouping the document tree into LaTeX files. List of tuples
205 # Grouping the document tree into LaTeX files. List of tuples
206 # (source start file, target name, title, author, document class [howto/manual]).
206 # (source start file, target name, title, author, document class [howto/manual]).
207
207
208 latex_documents = [
208 latex_documents = [
209 ('index', 'ipython.tex', 'IPython Documentation',
209 ('index', 'ipython.tex', 'IPython Documentation',
210 u"""The IPython Development Team""", 'manual', True),
210 u"""The IPython Development Team""", 'manual', True),
211 ('parallel/winhpc_index', 'winhpc_whitepaper.tex',
211 ('parallel/winhpc_index', 'winhpc_whitepaper.tex',
212 'Using IPython on Windows HPC Server 2008',
212 'Using IPython on Windows HPC Server 2008',
213 u"Brian E. Granger", 'manual', True)
213 u"Brian E. Granger", 'manual', True)
214 ]
214 ]
215
215
216 # The name of an image file (relative to this directory) to place at the top of
216 # The name of an image file (relative to this directory) to place at the top of
217 # the title page.
217 # the title page.
218 #latex_logo = None
218 #latex_logo = None
219
219
220 # For "manual" documents, if this is true, then toplevel headings are parts,
220 # For "manual" documents, if this is true, then toplevel headings are parts,
221 # not chapters.
221 # not chapters.
222 #latex_use_parts = False
222 #latex_use_parts = False
223
223
224 # Additional stuff for the LaTeX preamble.
224 # Additional stuff for the LaTeX preamble.
225 #latex_preamble = ''
225 #latex_preamble = ''
226
226
227 # Documents to append as an appendix to all manuals.
227 # Documents to append as an appendix to all manuals.
228 #latex_appendices = []
228 #latex_appendices = []
229
229
230 # If false, no module index is generated.
230 # If false, no module index is generated.
231 latex_use_modindex = True
231 latex_use_modindex = True
232
232
233
233
234 # Options for texinfo output
234 # Options for texinfo output
235 # --------------------------
235 # --------------------------
236
236
237 texinfo_documents = [
237 texinfo_documents = [
238 (master_doc, 'ipython', 'IPython Documentation',
238 (master_doc, 'ipython', 'IPython Documentation',
239 'The IPython Development Team',
239 'The IPython Development Team',
240 'IPython',
240 'IPython',
241 'IPython Documentation',
241 'IPython Documentation',
242 'Programming',
242 'Programming',
243 1),
243 1),
244 ]
244 ]
245
245
246 modindex_common_prefix = ['IPython.']
246 modindex_common_prefix = ['IPython.']
247
247
248
248
249 # Cleanup
249 # Cleanup
250 # -------
250 # -------
251 # delete release info to avoid pickling errors from sphinx
251 # delete release info to avoid pickling errors from sphinx
252
252
253 del iprelease
253 del iprelease
General Comments 0
You need to be logged in to leave comments. Login now