Git Product home page Git Product logo

Comments (5)

maeddlae avatar maeddlae commented on July 26, 2024

Update: In this example, the autodocsumm part splits the docstring into two parts!?

from detpack.utils.class_a import A

class B(A):
    """
    class B summary
    
    This is class B description
    
    **Example**
    
    .. code-block:: python
    
        b = B()
        b.meth_1(2)
        
    bliblu
    
    This this this
    """
    CLASS_ATTRIBUTE_B = 1 #: class attribute of class b

    def __init__(self):
        """
        This is the init docstring

        :param Fruit fruit: param line for sphinx autodoc
        """
        self.object_attribute_b = "jaja" #: this is an object attribute of class b
    
    def meth_2(self, a):
        """
        method b docstring
        
        :param int a: blublu b 
        :return: x is blibli b    
        """
        return a + 1

from autodocsumm.

Chilipp avatar Chilipp commented on July 26, 2024

Hi @maeddlae! Thanks for reporting this! It is not random in that sense, but it is not solved very well, I totally agree. The problem is, that autodocsumm has to insert the summary somewhere without knowing the exact documentation. There are some criteria (see

def inject_summ_nodes(self, doc_nodes, summ_nodes):
) but I see that they fail in your case. At the moment this insertion is rather something that is put on top of the generated nodes because then we do not have to replicate the code of autodoc. Maybe the functionality of the autodocsumm package should be implemented directly into the sphinx autodoc extension via PR. I'll have a look into this within the next days.

from autodocsumm.

maeddlae avatar maeddlae commented on July 26, 2024

Ok, thanks for investigating that:-)

from autodocsumm.

Chilipp avatar Chilipp commented on July 26, 2024

@maeddlae, the docstring is now always behind the docstring as I avoid this injection of the doc_nodes now

from autodocsumm.

Chilipp avatar Chilipp commented on July 26, 2024

Just a quick update: With #29 you can now also specify the exact positioning of the summary by adding the .. autoclasssumm directive in a class docstring, see https://autodocsumm.readthedocs.io/en/latest/examples.html#positioning-of-the-autosummary-table

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.