Skip to content

Commit b404e99

Browse files
committed
chore: Clean up (remove unused filters)
1 parent a4571a5 commit b404e99

1 file changed

Lines changed: 0 additions & 63 deletions

File tree

src/griffe2md/rendering.py

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -304,69 +304,6 @@ def do_order_members(
304304
return sorted(members, key=order_map[order])
305305

306306

307-
@lru_cache
308-
def _warn_crossref() -> None:
309-
warnings.warn(
310-
"The `crossref` filter is deprecated and will be removed in a future version",
311-
DeprecationWarning,
312-
stacklevel=1,
313-
)
314-
315-
316-
def do_crossref(path: str, *, brief: bool = True) -> Markup:
317-
"""Deprecated. Filter to create cross-references.
318-
319-
Parameters:
320-
path: The path to link to.
321-
brief: Show only the last part of the path, add full path as hover.
322-
323-
Returns:
324-
Markup text.
325-
"""
326-
_warn_crossref()
327-
full_path = path
328-
if brief:
329-
path = full_path.split(".")[-1]
330-
return Markup("<span data-autorefs-optional-hover={full_path}>{path}</span>").format(full_path=full_path, path=path)
331-
332-
333-
@lru_cache
334-
def _warn_multi_crossref() -> None:
335-
warnings.warn(
336-
"The `multi_crossref` filter is deprecated and will be removed in a future version",
337-
DeprecationWarning,
338-
stacklevel=1,
339-
)
340-
341-
342-
def do_multi_crossref(text: str, *, code: bool = True) -> Markup:
343-
"""Deprecated. Filter to create cross-references.
344-
345-
Parameters:
346-
text: The text to scan.
347-
code: Whether to wrap the result in a code tag.
348-
349-
Returns:
350-
Markup text.
351-
"""
352-
_warn_multi_crossref()
353-
group_number = 0
354-
variables = {}
355-
356-
def repl(match: Match) -> str:
357-
nonlocal group_number
358-
group_number += 1
359-
path = match.group()
360-
path_var = f"path{group_number}"
361-
variables[path_var] = path
362-
return f"<span data-autorefs-optional-hover={{{path_var}}}>{{{path_var}}}</span>"
363-
364-
text = re.sub(r"([\w.]+)", repl, text)
365-
if code:
366-
text = f"<code>{text}</code>"
367-
return Markup(text).format(**variables)
368-
369-
370307
def do_heading(content: str, heading_level: int) -> str:
371308
"""Render a Markdown heading."""
372309
return f"\n{'#' * heading_level} {content}\n\n"

0 commit comments

Comments
 (0)