File tree Expand file tree Collapse file tree 1 file changed +15
-14
lines changed
Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change 99from mkdocs_macros import plugin as macros
1010
1111
12- def define_env ( env : macros . MacrosPlugin ) -> None :
13- """Define the hook to create macro functions for use in Markdown .
12+ def _slugify ( text : str ) -> str :
13+ """Slugify a text .
1414
1515 Args:
16- env: The environment to define the macro functions in.
16+ text: The text to slugify.
17+
18+ Returns:
19+ The slugified text.
1720 """
21+ # The type of the return value is not defined for the markdown library.
22+ # Also for some reason `mypy` thinks the `toc` module doesn't have a
23+ # `slugify_unicode` function, but it definitely does.
24+ return toc .slugify_unicode (text , "-" ) # type: ignore[attr-defined,no-any-return]
1825
19- def _slugify (text : str ) -> str :
20- """Slugify a text.
2126
22- Args :
23- text: The text to slugify .
27+ def define_env ( env : macros . MacrosPlugin ) -> None :
28+ """Define the hook to create macro functions for use in Markdown .
2429
25- Returns:
26- The slugified text.
27- """
28- # The type of the return value is not defined for the markdown library.
29- # Also for some reason `mypy` thinks the `toc` module doesn't have a
30- # `slugify_unicode` function, but it definitely does.
31- return toc .slugify_unicode (text , "-" ) # type: ignore[attr-defined,no-any-return]
30+ Args:
31+ env: The environment to define the macro functions in.
32+ """
3233
3334 @env .macro # type: ignore[misc]
3435 def glossary (term : str ) -> str :
You can’t perform that action at this time.
0 commit comments