source: orange/docs/widgets/rst/conf.py @ 10881:f22adc7ab645

Revision 10881:f22adc7ab645, 10.3 KB checked in by mitar, 2 years ago (diff)

Use current version in documentation.

Line 
1# -*- coding: utf-8 -*-
2#
3# widgets documentation build configuration file, created by
4# sphinx-quickstart on Fri Oct  8 15:09:05 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
15
16import imp
17module_setup = imp.load_source('module_setup', os.path.join(os.path.dirname(__file__), '..', '..', '..', 'setup.py'))
18VERSION = module_setup.VERSION
19
20# If extensions (or modules to document with autodoc) are in another directory,
21# add these directories to sys.path here. If the directory is relative to the
22# documentation root, use os.path.abspath to make it absolute, like shown here.
23sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../')))
24import Orange
25
26# -- General configuration -----------------------------------------------------
27
28# Add any Sphinx extension module names here, as strings. They can be extensions
29# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
30extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
31              'sphinx.ext.pngmath']
32
33# Add any paths that contain templates here, relative to this directory.
34templates_path = ['_templates']
35
36# The suffix of source filenames.
37source_suffix = '.rst'
38
39# The encoding of source files.
40#source_encoding = 'utf-8'
41
42# The master toctree document.
43master_doc = 'index'
44
45# rst epilog with shortcuts for screen shoot numbers
46rst_epilog = """
47.. |1| image:: /../../sphinx-ext/themes/orange_theme/static/images/1.png
48       :align: middle
49       :alt: 1
50         
51.. |2| image:: /../../sphinx-ext/themes/orange_theme/static/images/2.png
52       :align: middle
53       :alt: 2
54
55.. |3| image:: /../../sphinx-ext/themes/orange_theme/static/images/3.png
56       :align: middle
57       :alt: 3
58       
59.. |4| image:: /../../sphinx-ext/themes/orange_theme/static/images/4.png
60       :align: middle
61       :alt: 4
62       
63.. |5| image:: /../../sphinx-ext/themes/orange_theme/static/images/5.png
64       :align: middle
65       :alt: 5
66       
67.. |6| image:: /../../sphinx-ext/themes/orange_theme/static/images/6.png
68       :align: middle
69       :alt: 6
70       
71.. |7| image:: /../../sphinx-ext/themes/orange_theme/static/images/7.png
72       :align: middle
73       :alt: 7
74       
75.. |8| image:: /../../sphinx-ext/themes/orange_theme/static/images/8.png
76       :align: middle
77       :alt: 8
78       
79.. |9| image:: /../../sphinx-ext/themes/orange_theme/static/images/9.png
80       :align: middle
81       :alt: 9
82       
83.. |10| image:: /../../sphinx-ext/themes/orange_theme/static/images/10.png
84       :align: middle
85       :alt: 10
86"""
87
88# General information about the project.
89project = u'Orange'
90copyright = u'Bioinformatics Laboratory, FRI UL'
91
92# The version info for the project you're documenting, acts as replacement for
93# |version| and |release|, also used in various other places throughout the
94# built documents.
95#
96# The short X.Y version.
97version = VERSION
98# The full version, including alpha/beta/rc tags.
99release = VERSION
100
101# The language for content autogenerated by Sphinx. Refer to documentation
102# for a list of supported languages.
103#language = None
104
105# There are two options for replacing |today|: either, you set today to some
106# non-false value, then it is used:
107#today = ''
108# Else, today_fmt is used as the format for a strftime call.
109#today_fmt = '%B %d, %Y'
110
111# List of documents that shouldn't be included in the build.
112#unused_docs = []
113
114# List of directories, relative to source directory, that shouldn't be searched
115# for source files.
116exclude_trees = ['_build']
117
118# The reST default role (used for this markup: `text`) to use for all documents.
119#default_role = None
120
121# If true, '()' will be appended to :func: etc. cross-reference text.
122#add_function_parentheses = True
123
124# If true, the current module name will be prepended to all description
125# unit titles (such as .. function::).
126#add_module_names = True
127
128# If true, sectionauthor and moduleauthor directives will be shown in the
129# output. They are ignored by default.
130#show_authors = False
131
132# The name of the Pygments (syntax highlighting) style to use.
133pygments_style = 'sphinx'
134
135# A list of ignored prefixes for module index sorting.
136#modindex_common_prefix = []
137
138
139# -- Options for HTML output ---------------------------------------------------
140
141# The theme to use for HTML and HTML Help pages.  Major themes that come with
142# Sphinx are currently 'default' and 'sphinxdoc'.
143html_theme = 'orange_theme'
144
145# Theme options are theme-specific and customize the look and feel of a theme
146# further.  For a list of options available for each theme, see the
147# documentation.
148html_theme_options = {"collapsiblesidebar": "false"}
149
150if html_theme == "orange_theme":
151    html_theme_options.update({"orangeheaderfooter": "false"})
152
153# Add any paths that contain custom themes here, relative to this directory.
154html_theme_path = ["../../sphinx-ext/themes"]
155
156# The name for this set of Sphinx documents.  If None, it defaults to
157# "<project> v<release> documentation".
158html_title = "Orange Widgets"
159
160# A shorter title for the navigation bar.  Default is the same as html_title.
161#html_short_title = None
162
163# The name of an image file (relative to this directory) to place at the top
164# of the sidebar.
165#html_logo = None
166
167# The name of an image file (within the static path) to use as favicon of the
168# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
169# pixels large.
170#html_favicon = None
171
172# Add any paths that contain custom static files (such as style sheets) here,
173# relative to this directory. They are copied after the builtin static files,
174# so a file named "default.css" will overwrite the builtin "default.css".
175
176# The old widgets documentation is copied here
177html_static_path = ["../../../Orange/doc/widgets"]
178
179# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
180# using the given strftime format.
181#html_last_updated_fmt = '%b %d, %Y'
182
183# If true, SmartyPants will be used to convert quotes and dashes to
184# typographically correct entities.
185#html_use_smartypants = True
186
187# Custom sidebar templates, maps document names to template names.
188#html_sidebars = {}
189
190# Additional templates that should be rendered to pages, maps page names to
191# template names.
192#html_additional_pages = {}
193
194# If false, no module index is generated.
195#html_use_modindex = True
196
197# If false, no index is generated.
198#html_use_index = True
199
200# If true, the index is split into individual pages for each letter.
201#html_split_index = False
202
203# If true, links to the reST sources are added to the pages.
204#html_show_sourcelink = True
205
206# If true, an OpenSearch description file will be output, and all pages will
207# contain a <link> tag referring to it.  The value of this option must be the
208# base URL from which the finished HTML is served.
209#html_use_opensearch = ''
210
211# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
212#html_file_suffix = ''
213
214# Output file base name for HTML help builder.
215htmlhelp_basename = 'widgetsdoc'
216
217
218# -- Options for LaTeX output --------------------------------------------------
219
220# The paper size ('letter' or 'a4').
221#latex_paper_size = 'letter'
222
223# The font size ('10pt', '11pt' or '12pt').
224#latex_font_size = '10pt'
225
226# Grouping the document tree into LaTeX files. List of tuples
227# (source start file, target name, title, author, documentclass [howto/manual]).
228latex_documents = [
229  ('index', 'widgets.tex', u'Widgets',
230   u'Biolab', 'manual'),
231]
232
233# The name of an image file (relative to this directory) to place at the top of
234# the title page.
235#latex_logo = None
236
237# For "manual" documents, if this is true, then toplevel headings are parts,
238# not chapters.
239#latex_use_parts = False
240
241# Additional stuff for the LaTeX preamble.
242#latex_preamble = ''
243
244# Documents to append as an appendix to all manuals.
245#latex_appendices = []
246
247# If false, no module index is generated.
248#latex_use_modindex = True
249
250# -- Options for Epub output ---------------------------------------------------
251
252# Bibliographic Dublin Core info.
253epub_title = u'Orange Widgets'
254epub_author = u'Biolab'
255epub_publisher = u'Biolab'
256epub_copyright = u'Bioinformatics Laboratory, FRI UL'
257
258# The language of the text. It defaults to the language option
259# or en if the language is not set.
260epub_language = 'en'
261
262# The scheme of the identifier. Typical schemes are ISBN or URL.
263#epub_scheme = ''
264
265# The unique identifier of the text. This can be a ISBN number
266# or the project homepage.
267#epub_identifier = ''
268
269# A unique identification for the text.
270#epub_uid = ''
271
272# HTML files that should be inserted before the pages created by sphinx.
273# The format is a list of tuples containing the path and title.
274#epub_pre_files = []
275
276# HTML files that should be inserted after the pages created by sphinx.
277# The format is a list of tuples containing the path and title.
278#epub_post_files = []
279
280# A list of files that should not be packed into the epub file.
281epub_exclude_files = ["index.html", "genindex.html", "py-modindex.html", "search.html"]
282
283# The depth of the table of contents in toc.ncx.
284#epub_tocdepth = 3
285
286# Allow duplicate toc entries.
287#epub_tocdup = True
288
289# Example configuration for intersphinx: refer to the Python standard library.
290intersphinx_mapping = {
291    'python': ('http://docs.python.org/', None),
292    'reference': ('http://orange.biolab.si/doc/reference/', 'http://orange.biolab.si/doc/reference/_objects/'),
293}
294
295from docutils import nodes
296from docutils.transforms import Transform
297 
298class StampListDecorate(Transform):
299    """Decorate a list with pixmap bullet points.
300   
301    Example::
302   
303        .. rst-class: stamp-list
304       
305            1. First
306            2. Second
307       
308       
309    """
310    default_priority = 1000
311    def apply(self):
312        for node in self.document.traverse(nodes.Node):
313            if isinstance(node,  nodes.Node) and not isinstance(node, nodes.Text):
314                if "stamp-list" in node["classes"][:]:
315                    self.decorate(node)
316               
317    def decorate(self, node):
318        for ol in node.traverse(nodes.enumerated_list):
319            start = int(ol["start"]) if "start" in ol else 1
320            for i, list_item in enumerate(ol.traverse(nodes.list_item)):
321                list_item["classes"].append("list-item-%i" % (start + i))
322
323def setup(app):
324    app.add_transform(StampListDecorate)
Note: See TracBrowser for help on using the repository browser.