diff --git a/docs/_css/mkdocstrings.css b/docs/_css/mkdocstrings.css index 572abff..851214f 100644 --- a/docs/_css/mkdocstrings.css +++ b/docs/_css/mkdocstrings.css @@ -42,3 +42,25 @@ a.autorefs-external::after { a.autorefs-external:hover::after { background-color: var(--md-accent-fg-color); } + +/* A "Deprecated" admonition, styled like a warning but with its own icon. */ +:root { + --md-admonition-icon--deprecated: url('data:image/svg+xml;charset=utf-8,'); +} + +.md-typeset .admonition.deprecated, +.md-typeset details.deprecated { + border-color: #cc9900; +} + +.md-typeset .deprecated > .admonition-title, +.md-typeset .deprecated > summary { + background-color: #cc99001a; +} + +.md-typeset .deprecated > .admonition-title::before, +.md-typeset .deprecated > summary::before { + background-color: #cc9900; + -webkit-mask-image: var(--md-admonition-icon--deprecated); + mask-image: var(--md-admonition-icon--deprecated); +} diff --git a/mkdocs.yml b/mkdocs.yml index d839d3d..d69c365 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -101,6 +101,10 @@ plugins: python: paths: ["src"] options: + extensions: + - griffe_warnings_deprecated: + kind: deprecated + title: Deprecated docstring_section_style: spacy inherited_members: true merge_init_into_class: false diff --git a/pyproject.toml b/pyproject.toml index 672e977..2ea7884 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,7 @@ dev-formatting = ["black == 26.5.1", "isort == 9.0.1"] dev-mkdocs = [ "Markdown == 3.10.3", "black == 26.5.1", + "griffe-warnings-deprecated == 1.1.1", "mike == 2.2.0", "mkdocs-gen-files == 0.6.1", "mkdocs-literate-nav == 0.6.3", diff --git a/src/frequenz/core/math.py b/src/frequenz/core/math.py index 2d1bb88..151f306 100644 --- a/src/frequenz/core/math.py +++ b/src/frequenz/core/math.py @@ -45,9 +45,9 @@ def __lt__(self, other: Self, /) -> bool: ) """Type variable for a value that is [`LessThanComparable`][..LessThanComparable] or `None`. -Warning: Deprecated - This type variable is deprecated and it will be removed in a future version. Use - [`LessThanComparableT`][..LessThanComparableT] instead. +Deprecated: + This type variable is deprecated since v1.4.0 and it will be removed in a + future version. Use [`LessThanComparableT`][..LessThanComparableT] instead. """