Skip to content

Commit 02d8681

Browse files
committed
Use new "optional" syntax from autorefs
1 parent 53db159 commit 02d8681

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

mkdocstrings/handlers/crystal/renderer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def do_reference(self, path: Union[str, DocPath], text: Optional[str] = None) ->
8585
except base.CollectionError:
8686
return text
8787
else:
88-
html = '<span data-mkdocstrings-identifier="{}">{}</span>'
88+
html = '<span data-autorefs-optional="{}">{}</span>'
8989
return Markup(html).format(ref_obj.abs_id, text)
9090

9191
def do_convert_markdown(self, text: str, context: DocItem, heading_level: int, html_id: str):
@@ -139,4 +139,4 @@ def run(self, root: etree.Element):
139139
el.tail = None
140140
# Put the `code` into the `span`, with a special attribute for mkdocstrings to pick up.
141141
span.append(el)
142-
span.set("data-mkdocstrings-identifier", ref_obj.abs_id)
142+
span.set("data-autorefs-optional", ref_obj.abs_id)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ deduplicate-toc = "mkdocstrings.handlers.crystal.deduplicate_toc:DeduplicateTocE
1818
python = "^3.7"
1919
mkdocstrings = "^0.15.0"
2020
markdown-callouts = "^0.1.0"
21+
mkdocs-autorefs = "^0.2.0"
2122
markupsafe = "^1.1.1"
2223
cached-property = "^1.5.2"
2324
Jinja2 = "^2.11.2"

0 commit comments

Comments
 (0)