source: orange/docs/widgets/rst/conf.py @ 10405:8b0053d48f75

Revision 10405:8b0053d48f75, 10.0 KB checked in by Ales Erjavec <ales.erjavec@…>, 2 years ago (diff)

Add old widget documentation to '_static'.

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