##// END OF EJS Templates
unmock some read-the-docs modules...
Matthias BUSSONNIER -
Show More
@@ -1,232 +1,213 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 class Mock(object):
28 def __init__(self, *args, **kwargs):
29 pass
30
31 def __call__(self, *args, **kwargs):
32 return Mock()
33
34 @classmethod
35 def __getattr__(self, name):
36 if name in ('__file__', '__path__'):
37 return '/dev/null'
38 elif name[0] == name[0].upper():
39 return type(name, (), {})
40 else:
41 return Mock()
42
43 MOCK_MODULES = ['matplotlib', 'matplotlib.sphinxext', 'numpy']
44 for mod_name in MOCK_MODULES:
45 sys.modules[mod_name] = Mock()
46
27
47 # 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
48 # 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
49 # absolute, like shown here.
30 # absolute, like shown here.
50 sys.path.insert(0, os.path.abspath('../sphinxext'))
31 sys.path.insert(0, os.path.abspath('../sphinxext'))
51
32
52 # Import support for ipython console session syntax highlighting (lives
33 # Import support for ipython console session syntax highlighting (lives
53 # in the sphinxext directory defined above)
34 # in the sphinxext directory defined above)
54 import ipython_console_highlighting
35 import ipython_console_highlighting
55
36
56 # We load the ipython release info into a dict by explicit execution
37 # We load the ipython release info into a dict by explicit execution
57 iprelease = {}
38 iprelease = {}
58 execfile('../../IPython/core/release.py',iprelease)
39 execfile('../../IPython/core/release.py',iprelease)
59
40
60 # General configuration
41 # General configuration
61 # ---------------------
42 # ---------------------
62
43
63 # Add any Sphinx extension module names here, as strings. They can be extensions
44 # Add any Sphinx extension module names here, as strings. They can be extensions
64 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
45 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
65 extensions = [
46 extensions = [
66 # 'matplotlib.sphinxext.mathmpl',
47 'matplotlib.sphinxext.mathmpl',
67 'matplotlib.sphinxext.only_directives',
48 'matplotlib.sphinxext.only_directives',
68 # 'matplotlib.sphinxext.plot_directive',
49 'matplotlib.sphinxext.plot_directive',
69 'sphinx.ext.autodoc',
50 'sphinx.ext.autodoc',
70 'sphinx.ext.doctest',
51 'sphinx.ext.doctest',
71 'inheritance_diagram',
52 'inheritance_diagram',
72 'ipython_console_highlighting',
53 'ipython_console_highlighting',
73 'ipython_directive',
54 'ipython_directive',
74 'numpydoc', # to preprocess docstrings
55 'numpydoc', # to preprocess docstrings
75 'github', # for easy GitHub links
56 'github', # for easy GitHub links
76 ]
57 ]
77
58
78 if ON_RTD:
59 if ON_RTD:
79 # Remove extensions not currently supported on RTD
60 # Remove extensions not currently supported on RTD
80 extensions.remove('matplotlib.sphinxext.only_directives')
61 extensions.remove('matplotlib.sphinxext.only_directives')
81 extensions.remove('ipython_directive')
62 extensions.remove('ipython_directive')
82
63
83 # Add any paths that contain templates here, relative to this directory.
64 # Add any paths that contain templates here, relative to this directory.
84 templates_path = ['_templates']
65 templates_path = ['_templates']
85
66
86 # The suffix of source filenames.
67 # The suffix of source filenames.
87 source_suffix = '.txt'
68 source_suffix = '.txt'
88
69
89 # The master toctree document.
70 # The master toctree document.
90 master_doc = 'index'
71 master_doc = 'index'
91
72
92 # General substitutions.
73 # General substitutions.
93 project = 'IPython'
74 project = 'IPython'
94 copyright = '2008, The IPython Development Team'
75 copyright = '2008, The IPython Development Team'
95
76
96 # ghissue config
77 # ghissue config
97 github_project_url = "https://github.com/ipython/ipython"
78 github_project_url = "https://github.com/ipython/ipython"
98
79
99 # The default replacements for |version| and |release|, also used in various
80 # The default replacements for |version| and |release|, also used in various
100 # other places throughout the built documents.
81 # other places throughout the built documents.
101 #
82 #
102 # The full version, including alpha/beta/rc tags.
83 # The full version, including alpha/beta/rc tags.
103 release = iprelease['version']
84 release = iprelease['version']
104 # The short X.Y version.
85 # The short X.Y version.
105 version = '.'.join(release.split('.',2)[:2])
86 version = '.'.join(release.split('.',2)[:2])
106
87
107
88
108 # There are two options for replacing |today|: either, you set today to some
89 # There are two options for replacing |today|: either, you set today to some
109 # non-false value, then it is used:
90 # non-false value, then it is used:
110 #today = ''
91 #today = ''
111 # Else, today_fmt is used as the format for a strftime call.
92 # Else, today_fmt is used as the format for a strftime call.
112 today_fmt = '%B %d, %Y'
93 today_fmt = '%B %d, %Y'
113
94
114 # List of documents that shouldn't be included in the build.
95 # List of documents that shouldn't be included in the build.
115 #unused_docs = []
96 #unused_docs = []
116
97
117 # List of directories, relative to source directories, that shouldn't be searched
98 # List of directories, relative to source directories, that shouldn't be searched
118 # for source files.
99 # for source files.
119 exclude_dirs = ['attic']
100 exclude_dirs = ['attic']
120
101
121 # If true, '()' will be appended to :func: etc. cross-reference text.
102 # If true, '()' will be appended to :func: etc. cross-reference text.
122 #add_function_parentheses = True
103 #add_function_parentheses = True
123
104
124 # If true, the current module name will be prepended to all description
105 # If true, the current module name will be prepended to all description
125 # unit titles (such as .. function::).
106 # unit titles (such as .. function::).
126 #add_module_names = True
107 #add_module_names = True
127
108
128 # If true, sectionauthor and moduleauthor directives will be shown in the
109 # If true, sectionauthor and moduleauthor directives will be shown in the
129 # output. They are ignored by default.
110 # output. They are ignored by default.
130 #show_authors = False
111 #show_authors = False
131
112
132 # The name of the Pygments (syntax highlighting) style to use.
113 # The name of the Pygments (syntax highlighting) style to use.
133 pygments_style = 'sphinx'
114 pygments_style = 'sphinx'
134
115
135
116
136 # Options for HTML output
117 # Options for HTML output
137 # -----------------------
118 # -----------------------
138
119
139 # The style sheet to use for HTML and HTML Help pages. A file of that name
120 # The style sheet to use for HTML and HTML Help pages. A file of that name
140 # must exist either in Sphinx' static/ path, or in one of the custom paths
121 # must exist either in Sphinx' static/ path, or in one of the custom paths
141 # given in html_static_path.
122 # given in html_static_path.
142 html_style = 'default.css'
123 html_style = 'default.css'
143
124
144 # The name for this set of Sphinx documents. If None, it defaults to
125 # The name for this set of Sphinx documents. If None, it defaults to
145 # "<project> v<release> documentation".
126 # "<project> v<release> documentation".
146 #html_title = None
127 #html_title = None
147
128
148 # The name of an image file (within the static path) to place at the top of
129 # The name of an image file (within the static path) to place at the top of
149 # the sidebar.
130 # the sidebar.
150 #html_logo = None
131 #html_logo = None
151
132
152 # Add any paths that contain custom static files (such as style sheets) here,
133 # Add any paths that contain custom static files (such as style sheets) here,
153 # relative to this directory. They are copied after the builtin static files,
134 # relative to this directory. They are copied after the builtin static files,
154 # so a file named "default.css" will overwrite the builtin "default.css".
135 # so a file named "default.css" will overwrite the builtin "default.css".
155 html_static_path = ['_static']
136 html_static_path = ['_static']
156
137
157 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
138 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
158 # using the given strftime format.
139 # using the given strftime format.
159 html_last_updated_fmt = '%b %d, %Y'
140 html_last_updated_fmt = '%b %d, %Y'
160
141
161 # If true, SmartyPants will be used to convert quotes and dashes to
142 # If true, SmartyPants will be used to convert quotes and dashes to
162 # typographically correct entities.
143 # typographically correct entities.
163 #html_use_smartypants = True
144 #html_use_smartypants = True
164
145
165 # Custom sidebar templates, maps document names to template names.
146 # Custom sidebar templates, maps document names to template names.
166 #html_sidebars = {}
147 #html_sidebars = {}
167
148
168 # Additional templates that should be rendered to pages, maps page names to
149 # Additional templates that should be rendered to pages, maps page names to
169 # template names.
150 # template names.
170 #html_additional_pages = {}
151 #html_additional_pages = {}
171
152
172 # If false, no module index is generated.
153 # If false, no module index is generated.
173 #html_use_modindex = True
154 #html_use_modindex = True
174
155
175 # If true, the reST sources are included in the HTML build as _sources/<name>.
156 # If true, the reST sources are included in the HTML build as _sources/<name>.
176 #html_copy_source = True
157 #html_copy_source = True
177
158
178 # If true, an OpenSearch description file will be output, and all pages will
159 # If true, an OpenSearch description file will be output, and all pages will
179 # contain a <link> tag referring to it. The value of this option must be the
160 # contain a <link> tag referring to it. The value of this option must be the
180 # base URL from which the finished HTML is served.
161 # base URL from which the finished HTML is served.
181 #html_use_opensearch = ''
162 #html_use_opensearch = ''
182
163
183 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
164 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
184 #html_file_suffix = ''
165 #html_file_suffix = ''
185
166
186 # Output file base name for HTML help builder.
167 # Output file base name for HTML help builder.
187 htmlhelp_basename = 'ipythondoc'
168 htmlhelp_basename = 'ipythondoc'
188
169
189
170
190 # Options for LaTeX output
171 # Options for LaTeX output
191 # ------------------------
172 # ------------------------
192
173
193 # The paper size ('letter' or 'a4').
174 # The paper size ('letter' or 'a4').
194 latex_paper_size = 'letter'
175 latex_paper_size = 'letter'
195
176
196 # The font size ('10pt', '11pt' or '12pt').
177 # The font size ('10pt', '11pt' or '12pt').
197 latex_font_size = '11pt'
178 latex_font_size = '11pt'
198
179
199 # Grouping the document tree into LaTeX files. List of tuples
180 # Grouping the document tree into LaTeX files. List of tuples
200 # (source start file, target name, title, author, document class [howto/manual]).
181 # (source start file, target name, title, author, document class [howto/manual]).
201
182
202 latex_documents = [
183 latex_documents = [
203 ('index', 'ipython.tex', 'IPython Documentation',
184 ('index', 'ipython.tex', 'IPython Documentation',
204 ur"""The IPython Development Team""", 'manual', True),
185 ur"""The IPython Development Team""", 'manual', True),
205 ('parallel/winhpc_index', 'winhpc_whitepaper.tex',
186 ('parallel/winhpc_index', 'winhpc_whitepaper.tex',
206 'Using IPython on Windows HPC Server 2008',
187 'Using IPython on Windows HPC Server 2008',
207 ur"Brian E. Granger", 'manual', True)
188 ur"Brian E. Granger", 'manual', True)
208 ]
189 ]
209
190
210 # The name of an image file (relative to this directory) to place at the top of
191 # The name of an image file (relative to this directory) to place at the top of
211 # the title page.
192 # the title page.
212 #latex_logo = None
193 #latex_logo = None
213
194
214 # For "manual" documents, if this is true, then toplevel headings are parts,
195 # For "manual" documents, if this is true, then toplevel headings are parts,
215 # not chapters.
196 # not chapters.
216 #latex_use_parts = False
197 #latex_use_parts = False
217
198
218 # Additional stuff for the LaTeX preamble.
199 # Additional stuff for the LaTeX preamble.
219 #latex_preamble = ''
200 #latex_preamble = ''
220
201
221 # Documents to append as an appendix to all manuals.
202 # Documents to append as an appendix to all manuals.
222 #latex_appendices = []
203 #latex_appendices = []
223
204
224 # If false, no module index is generated.
205 # If false, no module index is generated.
225 latex_use_modindex = True
206 latex_use_modindex = True
226
207
227
208
228 # Cleanup
209 # Cleanup
229 # -------
210 # -------
230 # delete release info to avoid pickling errors from sphinx
211 # delete release info to avoid pickling errors from sphinx
231
212
232 del iprelease
213 del iprelease
General Comments 0
You need to be logged in to leave comments. Login now