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
[autodoc] Allow :annotation:
to be used in docstring
#8022
Comments
+1: Reasonable. Please let me know your opinion before implementation. Is there any reason to control |
I think that individual control might not be as needed in class, but I think that it does make sense to be able to control individual appearance of constants in module. I admit that I don't use auto attribute that often, but from my point of view, the most common use case is to just not show the value of the constant for some specific constant while keeping it for the rest. But if someone uses IMO controlling individual |
Ah, sorry. I'd like to ask your opinion about adding a new configuration like |
Oh, I actually thought that such option already exists, but since it would not be useful for me, I didn't check for that in Sphinx's docs. class PermState(enum.Enum):
NONE = enum.auto()
"""No special privilege level."""
MOD = enum.auto()
"""User has the mod role."""
ADMIN = enum.auto()
"""User has the admin role."""
GUILD_OWNER = enum.auto()
"""User is the guild owner."""
APP_OWNER = enum.auto()
"""User is an app owner."""
class ConfigCategory(enum.Enum):
"""Represents config category."""
#: Global category.
GLOBAL = "GLOBAL"
#: Guild category.
GUILD = "GUILD"
#: Channel category.
CHANNEL = "TEXTCHANNEL"
#: Role category.
ROLE = "ROLE"
#: User category.
USER = "USER"
#: Member category.
MEMBER = "MEMBER" While the value of
So in short, it does not satisfy my case, but this is not a critical feature but rather an enhancement, so if you think this shouldn't be added to Sphinx yet, I'll accept that and just keep using the current solution for this with the hope that maybe some day it can be replaced with something that better suits my needs :) |
Thank you for comment. And I agree with your example |
I'd also find this useful: I have some large modules which are auto-documented (using |
Close #8022: autodoc: Allow to hide the value of the variables via metadata
Is your feature request related to a problem? Please describe.
Currently if I want to add an attribute (or module constant) and document it with-in a code (let's assume autoclass/automodule is in usage), I can't stop Sphinx from showing the value of it in that same docstring. Instead, I have to manually do this in automodule directive:
Describe the solution you'd like
I would want to be able to just add
:annotation:
directly in the docstring.Describe alternatives you've considered
Other than naming this role differently in docstring, I don't think there's anything else to do if I want to control this from docstring.
Additional context
N/A
The text was updated successfully, but these errors were encountered: