File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 88from markdown .extensions import toc
99from mkdocs_macros import plugin as macros
1010
11+ _CODE_ANNOTATION_MARKER : str = (
12+ r'<span class="md-annotation">'
13+ r'<span class="md-annotation__index" tabindex="-1">'
14+ r'<span data-md-annotation-id="1"></span>'
15+ r"</span>"
16+ r"</span>"
17+ )
18+
1119
1220def _slugify (text : str ) -> str :
1321 """Slugify a text.
@@ -30,6 +38,9 @@ def define_env(env: macros.MacrosPlugin) -> None:
3038 Args:
3139 env: The environment to define the macro functions in.
3240 """
41+ # A variable to easily show an example code annotation from mkdocs-material.
42+ # https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#adding-annotations
43+ env .variables ["code_annotation_marker" ] = _CODE_ANNOTATION_MARKER
3344
3445 @env .macro # type: ignore[misc]
3546 def glossary (term : str ) -> str :
You can’t perform that action at this time.
0 commit comments