Skip to content

mkdocstrings/griffe-warnings-deprecated

Repository files navigation

griffe-warnings-deprecated

ci documentation pypi version gitpod gitter

Griffe extension for @warnings.deprecated (PEP 702).

Installation

pip install griffe-warnings-deprecated

Usage

The option values in the following examples are the default ones, you can omit them if you like the defaults.

Command-line

griffe dump mypackage -e griffe_warnings_deprecated

See command-line usage in Griffe's documentation.

Python

import griffe

griffe.load(
    "mypackage",
    extensions=griffe.load_extensions(
        [{"griffe_warnings_deprecated": {
            "kind": "danger",
            "title": "Deprecated",
            "label": "deprecated"
        }}]
    )
)

See programmatic usage in Griffe's documentation.

MkDocs

plugins:
- mkdocstrings:
    handlers:
      python:
        options:
          extensions:
          - griffe_warnings_deprecated:
              kind: danger
              title: Deprecated

See MkDocs usage in Griffe's documentation.


Options:

  • kind: The admonition kind (default: danger).
  • title: The admonition title (default: Deprecated). Can be set to null to use the message as title.
  • label: The label added to deprecated objects (default: deprecated). Can be set to null.