Changeset 10037:7425b8360f0f in orange


Ignore:
Timestamp:
02/08/12 01:06:39 (2 years ago)
Author:
mitar
Branch:
default
Message:

Added autosingleton directive to Sphinx.

Location:
docs/reference/rst
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/Orange.evaluation.scoring.rst

    r10004 r10037  
    2727================== 
    2828 
     29.. autosingleton:: CA 
    2930.. autoclass:: CAClass 
    3031.. autofunction:: sens 
  • docs/reference/rst/conf.py

    r9735 r10037  
    258258 
    259259import types 
     260from sphinx.ext import autodoc 
    260261 
    261262def maybe_skip_member(app, what, name, obj, skip, options): 
     
    270271            return False 
    271272 
     273class SingletonDocumenter(autodoc.ModuleLevelDocumenter): 
     274    """ 
     275    Specialized Documenter subclass for singleton items. 
     276    """ 
     277    objtype = 'singleton' 
     278    directivetype = 'data' 
     279 
     280    member_order = 40 
     281 
     282    @classmethod 
     283    def can_document_member(cls, member, membername, isattr, parent): 
     284        return isinstance(parent, autodoc.ModuleDocumenter) and isattr 
     285 
     286    def document_members(self, all_members=False): 
     287        pass 
     288 
     289    def add_content(self, more_content, no_docstring=False): 
     290        self.add_line(u'Singleton instance of :py:class:`~%s`.' % (self.object.__class__.__name__,), '<autodoc>') 
     291 
    272292def setup(app): 
    273293    app.connect('autodoc-skip-member', maybe_skip_member) 
    274  
     294    app.add_autodocumenter(SingletonDocumenter) 
Note: See TracChangeset for help on using the changeset viewer.