Changeset 3224

Show
Ignore:
Timestamp:
02/12/08 19:08:57 (10 months ago)
Author:
athomas
Message:

Wiki format API docs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tracdeveloperplugin/trunk/tracdeveloper/apidoc.py

    r3222 r3224  
    77from trac.web import HTTPNotFound, IRequestHandler 
    88from trac.web.chrome import Chrome 
     9from trac.wiki.formatter import wiki_to_html 
    910 
    1011from tracdeveloper.util import linebreaks 
     
    3637            'module': modname, 
    3738            'name': attrname or modname, 
    38             'doc': linebreaks(inspect.getdoc(obj)), 
    39             'methods': self._get_methods(obj) 
     39            'doc': wiki_to_html(inspect.getdoc(obj), self.env, req), 
     40            'methods': self._get_methods(req, obj) 
    4041        } 
    4142        output = Chrome(self.env).render_template(req, 'developer/apidoc.html', 
     
    4546    # Internal methods 
    4647 
    47     def _get_methods(self, cls, exclude_methods=None): 
     48    def _get_methods(self, req, cls, exclude_methods=None): 
    4849        methods = [getattr(cls, m) for m in dir(cls) if not m.startswith('_') 
    4950                   and m not in (exclude_methods or [])] 
    5051        return [{'name': m.__name__, 
    5152                 'args': inspect.formatargspec(*inspect.getargspec(m)), 
    52                  'doc': linebreaks(inspect.getdoc(m))} 
     53                 'doc': wiki_to_html(inspect.getdoc(m), self.env, req)} 
    5354                for m in methods if inspect.ismethod(m)] 
  • tracdeveloperplugin/trunk/tracdeveloper/templates/developer/apidoc.html

    r3222 r3224  
    1414        <py:for each="method in methods"> 
    1515          <dt><code><strong>${method.name}</strong>${method.args}</code></dt> 
    16           <dd><p>${method.doc}</p></dd> 
     16          <dd>${method.doc}</dd> 
    1717        </py:for> 
    1818      </dl>