timothycrosley / portray

Your Project with Great Documentation.
MIT License
860 stars 72 forks source link

No class comments #77

Open JesseWebDotCom opened 3 years ago

JesseWebDotCom commented 3 years ago

Example: https://timothycrosley.github.io/portray/reference/portray/exceptions/

How come class comments do not display?

simonvanderveldt commented 3 years ago

Can confirm, this seems to be a regression introduced in version 1.5.0 We're sticking to 1.4.0 which correctly shows the comments from the class because of this.

Mike-Powell-ConcertAI commented 3 years ago

Thanks simon, same issue -- i reverted to v1.4, and it worked fine.

geniashand commented 2 years ago

I see that it wasn't solved in version 1.7.0 Should I just use the 1.4.0 version?

Also, I tried to search for the bug but couldn't find it. If someone would guide me where to look I could try and fix it.

simonvanderveldt commented 2 years ago

@geniashand I haven't had time to dive into it, so can't give you much with regards to pointers unfortunately. It seems like there are unfortunately no github releases nor tags for portray, but looking at the commits and assuming it's indeed a regression introduced between 1.4.0 and 1.5.0 it should be one of the changes between these two commits https://github.com/timothycrosley/portray/compare/e45d11487909bf083df70b884d4cd044840a62fe...0ffc51a85986d36379b9d8bf52a4fc62831366ba

ARBaart commented 2 years ago

@simonvanderveldt One of those commit ( 507d2f51c35061b799c24d5ce8c2c027cfdfba86 ) is bumping pdocs from 1.0.2 to 1.1.0, which is the package actually writing the markdown files based on the docstrings. So it's commit 507d2f51c35061b799c24d5ce8c2c027cfdfba86 in this repo, but the underlying issue would be found somewhere in the pdocs commits between 1.0.2 and 1.1.1

ARBaart commented 2 years ago

Okay I figured it out: In pdocs 1.0.2 due to a typo the parsing of docstrings (to extract params/returns) would always fail so you'd get the docstring displayed as-is. Going into 1.1.0 they fixed that by fixing the typo, but the display of a class's docstring doesn't include its short or long description, only the params.

So say your class is something like:

class Example:
    """This is the short description which is just the first line.

    Here is room for a longer description where you can go
    into detail on multiple lines if you like.

    :param value: A description of the param.
    """
    def __init__(value):
        self._value = value

Before it would print the thing as-is, with no formatting for that param. Now it succeeds in parsing it, but only displays the params, skipping the short and long description. And if you have no params in your docstring, it just displays nothing.