pdocs icon indicating copy to clipboard operation
pdocs copied to clipboard

dataclass support

Open jspaezp opened this issue 3 years ago • 0 comments

Hello there!

I love you package but wanted to know if this is a bug or on unsupported feature. I am trying to annotate a dataclass, defined here ....

cat foo/sample.py

from dataclasses import dataclass

@dataclass
class Child:
    name: str
    parents: list[str] = None

And generating the md documentation gives this ...

cat docs/foo/sample.md

# Module foo.sample

None

None

??? example "View Source"
        

        from dataclasses import dataclass

        

        @dataclass

        class Child:

            name: str

            parents: list[str] = None

        

## Classes

### Child

```python3
class Child(
    name: str,
    parents: list[str] = None
)
```

#### Class variables

```python3
parents
```%                                                                                                                                                                                             

Where arguments that have defaults are labelled as class variables.

Is there any intention to add support for classes defined from dataclasses? LMK, I could become more familiar with how this package works to submit a PR in the future if there is any interest. Thanks a lot!

Kindest wishes, Sebastian

jspaezp avatar Sep 21 '22 04:09 jspaezp