Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format classes' bases #8

Closed
wheerd opened this issue Oct 6, 2016 · 6 comments
Closed

Format classes' bases #8

wheerd opened this issue Oct 6, 2016 · 6 comments

Comments

@wheerd
Copy link
Contributor

wheerd commented Oct 6, 2016

I would like to have the extension also run the base classes through the annotation formatter, so that if I have some generic class, I can actually see the generic parameters in the documentation:

class MySpecialDict(Dict[str, int]):
    pass

Then in the docs it would render as:

MySpecialDict
    Bases: :class:`~typing.Dict`\[:class:`str`, :class:`int`]

Then generic parameters of base classes would be visible and correctly linked.

This would require a new hook in the autodoc extension. I got some local code where this is already working. Since that requires changes to the autodoc extension, I wanted to check first if that is desired.

@agronholm
Copy link
Collaborator

Yes, I approve.

@wheerd
Copy link
Contributor Author

wheerd commented Oct 6, 2016

Create an issue for the autodoc change: sphinx-doc/sphinx#3014

@agronholm
Copy link
Collaborator

Good luck with that. I have two pending, reviewed 1 or 2 line bugfix PRs with tests that have been collecting dust for 5 months.

@wheerd
Copy link
Contributor Author

wheerd commented Oct 15, 2016

It is also possible to monkey patch that functionallity in by replacing ClassDocumenter.add_directive_header. I don't know if you are okay with a not so clean solution.
If you are, I can provide a pull request...

@agronholm
Copy link
Collaborator

If you want your issue to go anywhere within this decade, I suggest you make a PR against Sphinx.

@gaborbernat
Copy link
Member

Closing as did not see activity for a long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants