Skip to content

Add Support for PEP 695 Generics #8417

@jonathan-laurent

Description

@jonathan-laurent

Context

Griffe recently added support for PEP 695 generics. It would b useful for mkdocs-material to support them too.

Description

There are mainly two features that would be worth having:

Documenting type aliases

Currently, trying to include documentation to type aliases (type MyAlias = ...) leads to a runtime exception:

jinja2.exceptions.UndefinedError: 'type_alias' is undefined

In a recent past version, the type_alias.html.jinja template was missing altogether so I imagine this is currently being worked on.

Adding support for "Type Parameters" Sections on Docstrings

Currently, these sections are not shown.

Related links

Use Cases

PEP 695 generics are seeing increasing adoption (since Python 3.12) and require specific mkdocs-material support.

Visuals

No response

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions