Skip to content

Commit

Permalink
refactor: Update cross-reference markup to new autorefs format
Browse files Browse the repository at this point in the history
Issue-6: #6
PR-7: #7
Co-authored-by: Timothée Mazzucotelli <[email protected]>
  • Loading branch information
mschoettle and pawamoy committed Sep 7, 2024
1 parent d426136 commit 89592bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ classifiers = [
]
dependencies = [
"mkdocstrings>=0.19",
"mkdocs-autorefs>=1.1",
"pytkdocs>=0.14",
]

Expand Down
2 changes: 1 addition & 1 deletion src/mkdocstrings_handlers/python/rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def do_brief_xref(path: str) -> Markup:
A span containing the brief cross-reference and the full one on hover.
"""
brief = path.split(".")[-1]
return Markup("<span data-autorefs-optional-hover={path}>{brief}</span>").format(path=path, brief=brief)
return Markup("<autoref identifier={path} optional hover>{brief}</autoref>").format(path=path, brief=brief)


def sort_object(obj: CollectorItem, sort_function: Callable[[CollectorItem], Any]) -> None:
Expand Down

0 comments on commit 89592bd

Please sign in to comment.