Adapt py:decorator from Python docs

Georg Brandl avatarGeorg Brandl created an issue

No description provided.

Comments (4)

  1. Dag Odenhall

    I still think this should be in autodoc as well. :) It would obviously not work for autodiscovered functions/methods, or those listed in :members:, but it would work where one would otherwise use the automethod/autofunction directives.

    Granted, autodecoratormethod is quite an unwieldy name for a directive. Perhaps instead a field?

    .. automethod:: route(string, methods=None)
       :decorator:
    

    Makes me wonder why the signature isn't just parsed for an at-sign though?

    .. function/method/auto*:: @route(string, methods=None)
    
  2. wweaver

    Any new thought about whether the autodecorator and autodecoratormethod directives will get added to autodoc. At least at a very basic level I was able to have autodecorator work for me just by extending the FunctionDocumenter class and setting objtype = 'decorator'

    class DecoratorDocumenter(FunctionDocumenter):
        """
        Specialized Documenter subclass for decorator functions.
        """
        objtype = 'decorator'
    
  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.