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

Make autodoc abbreviate long dictionaries #10146

Closed
not-my-profile opened this issue Jan 30, 2022 · 5 comments
Closed

Make autodoc abbreviate long dictionaries #10146

not-my-profile opened this issue Jan 30, 2022 · 5 comments

Comments

@not-my-profile
Copy link
Contributor

Examples in the wild:

babel.core.Locale.negotiate searx.engines.engine_shortcuts
image image

I think for long dictionaries it would be better if they were automatically abbreviated, or there at least should be an option to do so.

@not-my-profile not-my-profile added the type:enhancement enhance or introduce a new feature label Jan 30, 2022
@tk0miya
Copy link
Member

tk0miya commented Jan 30, 2022

How about using autodoc_preserve_defaults? If you're using a constant for the default value, the signature will become looking better.
https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_preserve_defaults

@not-my-profile
Copy link
Contributor Author

not-my-profile commented Jan 30, 2022

Ah I think this would help only with babel.core.Locale.negotiate but not with searx.engines.engine_shortcuts, which is a documented variable?

@tk0miya
Copy link
Member

tk0miya commented Jan 30, 2022

To suppress the value of variables and attributes, please use :no-value: option to the auto* directives.

@not-my-profile
Copy link
Contributor Author

But :no-value: cannot be used with automodule can it?

@tk0miya tk0miya added type:bug and removed type:enhancement enhance or introduce a new feature labels Jan 30, 2022
@tk0miya tk0miya added this to the 4.5.0 milestone Jan 30, 2022
@tk0miya
Copy link
Member

tk0miya commented Jan 30, 2022

OMG, it's not unexpected behavior. I'll fix it. The :no-value: option should be passed to both automodule directive and autodoc_default_options.

tk0miya added a commit to tk0miya/sphinx that referenced this issue Jan 30, 2022
tk0miya added a commit to tk0miya/sphinx that referenced this issue Jan 30, 2022
tk0miya added a commit to tk0miya/sphinx that referenced this issue Jan 30, 2022
@tk0miya tk0miya closed this as completed in b0b51ce Feb 6, 2022
tk0miya added a commit that referenced this issue Feb 6, 2022
…should_support_no-value

Close #10146: autodoc: autodoc_default_options does not support `no-value` option
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants