fralau / mkdocs-macros-plugin

Create richer and more beautiful pages in MkDocs, by using variables and calls to macros in the markdown code.
https://mkdocs-macros-plugin.readthedocs.io
Other
321 stars 50 forks source link

Leave undefined jinja2 variables as-is #116

Closed timvink closed 2 years ago

timvink commented 2 years ago

The current behaviour of mkdocs_macros_plugin is to (silently) replace an unknown jinja2 variable with an empty string.

For example {{ foobar }} in a markdown document will be replaced by ""

This PR changes that behaviour and leaves the jinja string ({{ foobar }} --> {{ foobar }})

Context is that other plugins might also define custom jinja2 variables. See for example https://github.com/timvink/mkdocs-git-authors-plugin/issues/60

fralau commented 2 years ago

Thanks a lot, this entirely makes sense.

There are a few general questions we need to solve, and there might be more than one update. May I ask you to also open an issue?