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: Disable category display #120

Closed
Viicos opened this issue Jan 7, 2024 · 3 comments · Fixed by #130
Closed

feature: Disable category display #120

Viicos opened this issue Jan 7, 2024 · 3 comments · Fixed by #130
Assignees

Comments

@Viicos
Copy link
Contributor

Viicos commented Jan 7, 2024

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:

image

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

Describe alternatives you've considered

Additional context

@pawamoy
Copy link
Member

pawamoy commented Jan 9, 2024

Hello, thanks for the request.

set from a dict

What do you mean by that exactly?

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.

If you want to globally hide labels, you can override the labels.html template 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
Copy link
Contributor Author

Viicos commented Jan 9, 2024

Hi

What do you mean by that exactly?

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.

If you want to globally hide labels, you can override the labels.html template with empty contents.

Great to here that is possible to override this behavior/

Or did you want to have a global/local option (in mkdocs.yml and in ::: autodoc instructions) to show/hide labels?

Ideally yes. If you agree with this feature, I can work on the implementation

@pawamoy
Copy link
Member

pawamoy commented Jan 9, 2024

I see, thanks. I'm OK with a new show_labels option defaulting to true 🙂

pawamoy pushed a commit that referenced this issue Feb 5, 2024
viktorlashchuk added a commit to viktorlashchuk/mkdocstrings-python that referenced this issue Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants