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
318 stars 50 forks source link

Update plugin.py #222

Closed FredZinelli closed 3 months ago

FredZinelli commented 4 months ago

Hello,

I'm currently creating an mkdocs tool using your plugin and I have 2 suggestions to submit to you.

  1. Add yaml_encoding:

    A colleague of mine ran into some troubles because the MacrosPlugin._load_yaml method is calling open(...) without encoding. So I added a config variable for that, defaulting to empty string. If empty string is found, the default encoding is used, to mimic the original behavior, otherwise, the value given in mkdocs.yml will be used

  2. Add on_error_reraise:

    In my current project, I'd like to actually directly raise errors during rendering operations, instead of the "double error message" due to formatting, then exiting. So I added this new configuration variable.

Is that fine for you?

Regards, FredZinelli