source: orange/docs/reference/rst/conf.py @ 9615:473bf3393974

Revision 9615:473bf3393974, 9.1 KB checked in by anze <anze.staric@…>, 2 years ago (diff)

Add local orange dir to path when building documentation.

Line 
1# -*- coding: utf-8 -*-
2#
3# reference documentation build configuration file, created by
4# sphinx-quickstart on Wed Nov 17 12:52:23 2010.
5#
6# This file is execfile()d with the current directory set to its containing dir.
7#
8# Note that not all possible configuration values are present in this
9# autogenerated file.
10#
11# All configuration values have a default; values that are commented out
12# serve to show the default.
13
14import sys, os, os.path
15
16#rewrite formatargs function with different defaults
17sys.path.insert(0, os.path.dirname(__file__))
18import myinspect
19import sphinx.ext.autodoc
20import numpydoc
21sphinx.ext.autodoc.inspect = myinspect
22numpydoc.docscrape.inspect = myinspect
23
24#disable deprecation decorators for the documentation
25os.environ["orange_no_deprecated_members"] = "1"
26
27# If extensions (or modules to document with autodoc) are in another directory,
28# add these directories to sys.path here. If the directory is relative to the
29# documentation root, use os.path.abspath to make it absolute, like shown here.
30sys.path.append(os.path.abspath('../../../orange'))
31
32# -- General configuration -----------------------------------------------------
33
34# Add any Sphinx extension module names here, as strings. They can be extensions
35# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
36extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig', 'numpydoc']
37
38
39# Numpydoc generates autosummary directives for all undocumented members. Orange documentation only includes documented
40# member, so _str_member_list is modified to return [] where a list of undocumented members is originally returned.
41numpydoc.docscrape_sphinx.SphinxDocString._str_member_list # if numpydoc changes, this line will cause an error
42numpydoc.docscrape_sphinx.SphinxDocString._str_member_list = lambda x, y : []
43
44
45# Add any paths that contain templates here, relative to this directory.
46templates_path = ['_templates']
47
48# The suffix of source filenames.
49source_suffix = '.rst'
50
51# The encoding of source files.
52#source_encoding = 'utf-8'
53
54# The master toctree document.
55master_doc = 'index'
56
57# General information about the project.
58project = u'Orange'
59copyright = u'Bioinformatics Laboratory, FRI UL'
60
61# The version info for the project you're documenting, acts as replacement for
62# |version| and |release|, also used in various other places throughout the
63# built documents.
64#
65# The short X.Y version.
66version = '2.5'
67# The full version, including alpha/beta/rc tags.
68release = '2.5 beta'
69
70# The language for content autogenerated by Sphinx. Refer to documentation
71# for a list of supported languages.
72#language = None
73
74# There are two options for replacing |today|: either, you set today to some
75# non-false value, then it is used:
76#today = ''
77# Else, today_fmt is used as the format for a strftime call.
78#today_fmt = '%B %d, %Y'
79
80# List of documents that shouldn't be included in the build.
81#unused_docs = []
82
83# List of directories, relative to source directory, that shouldn't be searched
84# for source files.
85exclude_trees = ['_build']
86
87# The reST default role (used for this markup: `text`) to use for all documents.
88#default_role = None
89
90# If true, '()' will be appended to :func: etc. cross-reference text.
91#add_function_parentheses = True
92
93# If true, the current module name will be prepended to all description
94# unit titles (such as .. function::).
95#add_module_names = True
96
97# If true, sectionauthor and moduleauthor directives will be shown in the
98# output. They are ignored by default.
99#show_authors = False
100
101# The name of the Pygments (syntax highlighting) style to use.
102pygments_style = 'sphinx'
103
104# A list of ignored prefixes for module index sorting.
105#modindex_common_prefix = []
106
107
108# -- Options for HTML output ---------------------------------------------------
109
110# The theme to use for HTML and HTML Help pages.  Major themes that come with
111# Sphinx are currently 'default' and 'sphinxdoc'.
112html_theme = 'orange_theme'
113
114# Theme options are theme-specific and customize the look and feel of a theme
115# further.  For a list of options available for each theme, see the
116# documentation.
117html_theme_options = {"collapsiblesidebar": "false"}
118
119if html_theme == "orange_theme":
120    html_theme_options.update({"orangeheaderfooter": "false"})
121
122# Add any paths that contain custom themes here, relative to this directory.
123html_theme_path = ["../../sphinx-ext/themes"]
124
125# The name for this set of Sphinx documents.  If None, it defaults to
126# "<project> v<release> documentation".
127html_title = "Orange Scripting Reference"
128
129# A shorter title for the navigation bar.  Default is the same as html_title.
130#html_short_title = None
131
132# The name of an image file (relative to this directory) to place at the top
133# of the sidebar.
134#html_logo = None
135
136# The name of an image file (within the static path) to use as favicon of the
137# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
138# pixels large.
139#html_favicon = None
140
141# Add any paths that contain custom static files (such as style sheets) here,
142# relative to this directory. They are copied after the builtin static files,
143# so a file named "default.css" will overwrite the builtin "default.css".
144html_static_path = []
145
146# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
147# using the given strftime format.
148#html_last_updated_fmt = '%b %d, %Y'
149
150# If true, SmartyPants will be used to convert quotes and dashes to
151# typographically correct entities.
152#html_use_smartypants = True
153
154# Custom sidebar templates, maps document names to template names.
155#html_sidebars = {}
156
157# Additional templates that should be rendered to pages, maps page names to
158# template names.
159#html_additional_pages = {}
160
161# If false, no module index is generated.
162#html_use_modindex = True
163
164# If false, no index is generated.
165#html_use_index = True
166
167# If true, the index is split into individual pages for each letter.
168#html_split_index = False
169
170# If true, links to the reST sources are added to the pages.
171#html_show_sourcelink = True
172
173# If true, an OpenSearch description file will be output, and all pages will
174# contain a <link> tag referring to it.  The value of this option must be the
175# base URL from which the finished HTML is served.
176#html_use_opensearch = ''
177
178# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
179#html_file_suffix = ''
180
181# Output file base name for HTML help builder.
182htmlhelp_basename = 'referencedoc'
183
184
185# -- Options for LaTeX output --------------------------------------------------
186
187# The paper size ('letter' or 'a4').
188#latex_paper_size = 'letter'
189
190# The font size ('10pt', '11pt' or '12pt').
191#latex_font_size = '10pt'
192
193# Grouping the document tree into LaTeX files. List of tuples
194# (source start file, target name, title, author, documentclass [howto/manual]).
195latex_documents = [
196  ('index', 'reference.tex', u'Reference',
197   u't', 'manual'),
198]
199
200# The name of an image file (relative to this directory) to place at the top of
201# the title page.
202#latex_logo = None
203
204# For "manual" documents, if this is true, then toplevel headings are parts,
205# not chapters.
206#latex_use_parts = False
207
208# Additional stuff for the LaTeX preamble.
209#latex_preamble = ''
210
211# Documents to append as an appendix to all manuals.
212#latex_appendices = []
213
214# If false, no module index is generated.
215#latex_use_modindex = True
216
217# -- Options for Epub output ---------------------------------------------------
218
219# Bibliographic Dublin Core info.
220epub_title = u'Orange Scripting Reference'
221epub_author = u'Biolab'
222epub_publisher = u'Biolab'
223epub_copyright = u'Bioinformatics Laboratory, FRI UL'
224
225# The language of the text. It defaults to the language option
226# or en if the language is not set.
227epub_language = 'en'
228
229# The scheme of the identifier. Typical schemes are ISBN or URL.
230#epub_scheme = ''
231
232# The unique identifier of the text. This can be a ISBN number
233# or the project homepage.
234#epub_identifier = ''
235
236# A unique identification for the text.
237#epub_uid = ''
238
239# HTML files that should be inserted before the pages created by sphinx.
240# The format is a list of tuples containing the path and title.
241#epub_pre_files = []
242
243# HTML files that should be inserted after the pages created by sphinx.
244# The format is a list of tuples containing the path and title.
245#epub_post_files = []
246
247# A list of files that should not be packed into the epub file.
248epub_exclude_files = ["index.html", "genindex.html", "py-modindex.html", "search.html"]
249
250# The depth of the table of contents in toc.ncx.
251#epub_tocdepth = 3
252
253# Allow duplicate toc entries.
254#epub_tocdup = True
255
256# Example configuration for intersphinx: refer to the Python standard library.
257intersphinx_mapping = {'http://docs.python.org/': None}
258
259import types
260
261def maybe_skip_member(app, what, name, obj, skip, options):
262    #print app, what, name, obj, skip, options
263
264    #allow class methods that begin with __ and end with __
265    if isinstance(obj, types.MethodType) \
266        and not isinstance(options.members, list) \
267        and name.startswith("__") \
268        and name.endswith("__") \
269        and (obj.__doc__ != None or options.get("undoc-members", False)):
270            return False
271
272def setup(app):
273    app.connect('autodoc-skip-member', maybe_skip_member)
274
Note: See TracBrowser for help on using the repository browser.