pdoc3 / pdoc3/pdoc

Type hints for custom objects not linked

Open
#333 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.2k
Forks
146
PR merge metrics
No merged PRs in 30d

Description

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
  • pdoc version: pdoc3 0.9.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided 20210409_pdoc.py example and pdoc3 20210409_pdoc.py --html. Trace how the generated documentation renders the Child annotations, then verify that custom-object type hints link to the documented class instead of displaying the filename.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.