Closed skwde closed 1 year ago
Welcome to this project and thank you!' first issue
Thanks a lot for your comment. So far, I was not aware there was a --strict
option in mkdocs serve
, and no one mentioned it here. I had not studied why it doesn't have the effect you expected with mkdocs-macros.
The standard way to achieve that effect (abord the build) is to use the on_error_fail
option in the config file, (see #133 and documentation).
Would that solve it for you?
Thanks for your quick response and sorry that I missed this in the documentation. I only checked the section https://mkdocs-macros-plugin.readthedocs.io/en/latest/#installation for possible options.
I now set the option
on_error_fail: true
but the build / serve process does not stop, instead it continues silently with
DEBUG - [macros] - Undefined behavior: <class 'jinja2.runtime.DebugUndefined'>
while simply rendering as standard text. See below.
mkdocs-macros does no raise an error in that case. If you want to raise an error in that case as well:
on_undefined: strict
See the full explanation.
@fralau thanks for your feedback.
I can conform that this now works.
Only after adding
on_undefined: strict
an error is raised in both cases, serving and building.
A macro error (e.g. Macro Syntax Error) is not exiting the build / serve of the mkdocs page, even though
is used.
Here is how you can reproduce the issue
This gives the error
python 3.10.6 mkdocs 1.4.2 mkdocs-macros-plugin 0.7.0 jinja2 3.1.2