INNER CODE UNIT · Python
_format_template_syntax_error
fralau/mkdocs-macros-plugin · mkdocs_macros/errors.py:29
def _format_template_syntax_error(
error: TemplateSyntaxError,
markdown: str,
page: Page,
) -> str:
"""Template rendering failed."""
line = markdown.splitlines()[error.lineno - 1]
return textwrap.dedent(
f'''
# _Macro Syntax Error_
_File_: `{page.file.src_path}`
_Line {error.lineno} in Markdown file:_ **{error.message}**
```markdown
{line}
```
'''