8000 fix: Render enumeration instance name instead of just "value", allowi… · melissawm/mkdocstrings-python@11d81d8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 11d81d8

Browse files
committed
fix: Render enumeration instance name instead of just "value", allowing proper cross-reference
Issue-124: mkdocstrings#124
1 parent 9f8456a commit 11d81d8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ classifiers = [
2929
]
3030
dependencies = [
3131
"mkdocstrings>=0.24.2",
32-
"griffe>=0.37",
32+
"griffe>=0.44",
3333
]
3434

3535
[project.urls]

src/mkdocstrings_handlers/python/templates/material/_base/expression.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
{{ render(expression.slice.elements[0], annotations_path) }}
3030
{%- elif expression.classname == "ExprAttribute" -%}
3131
{%- if annotations_path == "brief" -%}
32-
{{ render(expression.last, "brief") }}
32+
{%- if expression.last.is_enum_value -%}
33+
{{ crossref(expression.last.parent, "brief") }}.value
34+
{%- else -%}
35+
{{ render(expression.last, "brief") }}
36+
{%- endif -%}
3337
{%- elif annotations_path == "full" -%}
3438
{{ render(expression.first, "full") }}
3539
{%- for element in expression -%}

0 commit comments

Comments
 (0)
0