pdoc3 / pdoc

:snake: :arrow_right: :scroll: Auto-generate API documentation for Python projects
https://pdoc3.github.io/pdoc/
GNU Affero General Public License v3.0
1.12k stars 145 forks source link

Type hints for custom objects not linked #333

Open cgebbe opened 3 years ago

cgebbe commented 3 years ago

Expected Behavior

File called 20210409_pdoc.py

class Child:
    def __init__(self, name: str ="child"):
        """
        One child description

        Args:
            name: name of child
        """
        self.name: str = name

class Parent:
    cls_child: Child = Child("name of cls child")

    def __init__(self, child: Child = None):
        """
        Parent object

        Args:
            child: child instance
        """
        self.child: Child = child

Running pdoc3 20210409_pdoc.py --html yields

image

Ideally, the type hints would be links to the actual class.

Actual Behavior

No links, but instead the filename is printed

Additional info

kernc commented 3 years ago

Curiously, it works if I rename the file so it doesn't start with numbers:

mv 20210409_pdoc.py test_hints.py

:thinking: