Git Product home page Git Product logo

Comments (5)

Chilipp avatar Chilipp commented on August 30, 2024

Hi @maeddlae! Thanks again for your report! Could you please be a bit more explicit? Because I could not reproduce this problemDo I get you right, that if you have something like

class A:
    "Doc of A"
    pass

class B(A):
    "Doc of B"
    pass

in a file named test.py, then B appears under the miscellaneous section in

.. automodule:: test
    :autosummary:
    :members:

?

from autodocsumm.

maeddlae avatar maeddlae commented on August 30, 2024

Sorry for answering that late. I didn't see your question earlier. Here is an example:

class A():
    """
    Class A docstring
    """    
    class SubClassOfA():
        """
        Class SubClassOfA docstring
        """
    
        def __init__(self):
            """
            Init of class SubClassOfA
            """
            pass
        
    def __init__(self):
        """
        Init of class A
        """
        pass
    
    def met1(self):
        """
        Method 1 of class A
        """
        pass

The generated API then looks like this:
image

from autodocsumm.

Chilipp avatar Chilipp commented on August 30, 2024

Hi @maeddlae! Thanks for the clarification 😄 As workaround, you can define your own grouper in conf.py, for example

def grouper(app, what, name, obj, section, parent):
    if isinstance(obj, type) and isinstance(parent, type):
        return "Class"

def setup(app):
    app.connect('autodocsumm-grouper', grouper)

However, we can also change the current behaviour of autodocsumm. Any suggestion, under which section the SubClassOfA should appear? Maybe Member classes?

from autodocsumm.

maeddlae avatar maeddlae commented on August 30, 2024

Hmm, I would say just "Class" would be ok. But Python calls them "Inner Class" or "Nested Class", see https://pythonspot.com/inner-classes/.

from autodocsumm.

Chilipp avatar Chilipp commented on August 30, 2024

Agreed. I just implemented the necessary changes in #17 which then closes this issue. Would you mind confirming that it fulfills the request?

from autodocsumm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.