Closed timvink closed 2 years ago
The mkdocs-markdownextradata-plugin
takes a different approach and creates its own jinja2 environment, which it applies during on_page_markdown
(link).
That means it will give TemplatingErrors for any jinja tags or macros that are not defined. We would have the same problem..
A specific problem we have in #21 is that a tag like {{read_csv('path')}}
is a valid jinja2 tag but not replaced by table_reader
because of the missing space padding. Any other plugin that then uses jinja2
will complain about not knowing about the read_csv macro.
A more robust approach might be to make the regex replacement more robust and not enforce space padding:
Another alternative is using a completely different syntax, like ||| read_csv() |||
but that's not user friendly.
Related to #14 and #20 , a different approach might work better: add macros to the jinja2 environment.