Ignore:
Timestamp:
11/14/12 13:09:26 (17 months ago)
Author:
Miha Stajdohar <miha.stajdohar@…>
Branch:
default
rebase_source:
e93acb1373615b75d8bff7e0f362efc20e6ea83f
Message:

Added a common documentation index.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/widgets/rst/conf.py

    r10881 r11028  
    1212# serve to show the default. 
    1313 
    14 import sys, os 
     14import os, sys 
    1515 
    16 import imp 
    17 module_setup = imp.load_source('module_setup', os.path.join(os.path.dirname(__file__), '..', '..', '..', 'setup.py')) 
    18 VERSION = module_setup.VERSION 
     16sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))) 
    1917 
    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. 
    23 sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../'))) 
    24 import Orange 
     18from conf import * 
    2519 
    26 # -- General configuration ----------------------------------------------------- 
     20TITLE = "%s v%s" % ("Orange Widgets", VERSION) 
    2721 
    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. 
    30 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 
    31               'sphinx.ext.pngmath'] 
     22html_title = TITLE 
     23epub_title = TITLE 
    3224 
    33 # Add any paths that contain templates here, relative to this directory. 
    34 templates_path = ['_templates'] 
     25latex_documents = [ 
     26    ('index', 'reference.tex', TITLE, 
     27     AUTHOR, 'manual'), 
     28    ] 
    3529 
    36 # The suffix of source filenames. 
    37 source_suffix = '.rst' 
    3830 
    39 # The encoding of source files. 
    40 #source_encoding = 'utf-8' 
    41  
    42 # The master toctree document. 
    43 master_doc = 'index' 
    4431 
    4532# rst epilog with shortcuts for screen shoot numbers 
     
    8572       :alt: 10 
    8673""" 
    87  
    88 # General information about the project. 
    89 project = u'Orange' 
    90 copyright = 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. 
    97 version = VERSION 
    98 # The full version, including alpha/beta/rc tags. 
    99 release = 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. 
    116 exclude_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. 
    133 pygments_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'. 
    143 html_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. 
    148 html_theme_options = {"collapsiblesidebar": "false"} 
    149  
    150 if 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. 
    154 html_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". 
    158 html_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 
    177 html_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. 
    215 htmlhelp_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]). 
    228 latex_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. 
    253 epub_title = u'Orange Widgets' 
    254 epub_author = u'Biolab' 
    255 epub_publisher = u'Biolab' 
    256 epub_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. 
    260 epub_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. 
    281 epub_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. 
    290 intersphinx_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  
    295 from docutils import nodes 
    296 from docutils.transforms import Transform 
    297   
    298 class 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  
    323 def setup(app): 
    324     app.add_transform(StampListDecorate) 
Note: See TracChangeset for help on using the changeset viewer.