You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It would be nice to be able to disable the category being displayed. I'm documenting config values from a dataclass and as I set default values, I get both class-attribute and instance-attribute, but these are not relevant to the user as those config values are actually set from a dict:
Describe the solution you'd like
An option (e.g. disable_category) to have categories not being displayed. Apologies if this should fit in the griffe repo
The class-attribute and instance-attribute labels are here to tell that you can access these attributes directly on the class and/or on instances of this class.
So long story short I'm making a Django app where the end user uses a plain dict (i.e. MY_SETTINGS = {"LOCAL_STUBS_DIR": ...}) and I'm internally keeping track of the user settings by converting everything into a dataclass. So I'm making use of mkdocstrings to actually show the available configuration values, but the dataclass is an implementation detail, that's why having the category labels isn't relevant as the end user only deals with a plain dict.
Activity
pawamoy commentedon Jan 9, 2024
Hello, thanks for the request.
What do you mean by that exactly?
The
class-attributeandinstance-attributelabels are here to tell that you can access these attributes directly on the class and/or on instances of this class.If you want to globally hide labels, you can override the
labels.htmltemplate with empty contents.Or did you want to have a global/local option (in mkdocs.yml and in
:::autodoc instructions) to show/hide labels?Viicos commentedon Jan 9, 2024
Hi
So long story short I'm making a Django app where the end user uses a plain dict (i.e.
MY_SETTINGS = {"LOCAL_STUBS_DIR": ...}) and I'm internally keeping track of the user settings by converting everything into a dataclass. So I'm making use ofmkdocstringsto actually show the available configuration values, but the dataclass is an implementation detail, that's why having the category labels isn't relevant as the end user only deals with a plain dict.Great to here that is possible to override this behavior/
Ideally yes. If you agree with this feature, I can work on the implementation
pawamoy commentedon Jan 9, 2024
I see, thanks. I'm OK with a new
show_labelsoption defaulting to true 🙂feat: Add `show_labels` option to show/hide labels
feat: Add `show_labels` option to show/hide labels