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

feature: show only the 'summary' of attributes and include defaults #235

Closed
osamimi opened this issue Jan 27, 2025 · 1 comment
Closed
Assignees
Labels
feature New feature or request

Comments

@osamimi
Copy link

osamimi commented Jan 27, 2025

Sometimes you have a class / data class that has a lot of attributes (e.g. to store configuration of something)
You end up with a long list of attributes which also show up in the ToC and clutter the documentation:

Image

With summary = true, you can get a nice table which is much denser but IMO also easier to digest:

Image

However, there are two problems:

  • As far as I can tell, you cannot hide the individual listings of the attributes and only keep the summary table.
  • The summary table is missing the default value if it exits.

What I am looking for is for classes to render very similar to how functions are handled:

  • a table of attributes with default values just like the table of parameters of a function
  • no individual listing of attributes (same as how you can avoid that for functions with parameter_headings = False)
  • the signature of __init__() to clearly show the user how to create an instance of the class (see feature: support for __init__() of pedantic/attrs classes #234)
    Image
@osamimi osamimi added the feature New feature or request label Jan 27, 2025
@pawamoy
Copy link
Member

pawamoy commented Jan 28, 2025

Hey @osamimi, thanks again for the request!

As mentioned in #234 (comment), this is currently not possible indeed, but is tracked in these other issues:

Please upvote these issues to show your interest and boost their priority!

Since it's tracked elsewhere, I'll close this issue, but I'm happy to continue the discussion here 😄

@pawamoy pawamoy closed this as completed Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants