Skip to content

feature: Disable category display #120

Closed

Description

@Viicos

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

Activity

  1. pawamoy commented on Jan 9, 2024

    @pawamoy
    Member

    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?

  2. Viicos commented on Jan 9, 2024

    @Viicos
    ContributorAuthor

    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

  3. pawamoy commented on Jan 9, 2024

    @pawamoy
    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions