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