Closed operte closed 3 years ago
I updated the documentation to inform the user about this option.
In addition, apply_template
now catches the TemplateSyntaxError
that jinja
raises when the file or foldername is not valid. It informs the users about the extra
option, refers them to the documentation, and raises the TemplateSyntaxError
anyway, since the error might have been raised for another reason.
Please add yourself to the README.md as contributors :) and this can go out as the next release
Ah yes let me add Tim as well, since he helped think this through. I think he also contributed to the project in the past as well :)
Thanks for your contrib ❤️
Hey Ross, can you give us an estimate of when there will be a new release? :)
https://pypi.org/project/mkdocs-markdownextradata-plugin/
last Saturday evening ;)
On Mon, Mar 1, 2021 at 9:42 AM João Moura notifications@github.com wrote:
Hey Ross, can you give us an estimate of when there will be a new release? :)
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/rosscdh/mkdocs-markdownextradata-plugin/pull/35#issuecomment-787767857, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADA6MWMNAZ3ZIKRKLMS65TTBNHQBANCNFSM4YILX4WA .
Oh cool, for some reason I don't see the newer releases here on Github. Thanks a lot! :)
This modification allows the user to call
extra
as the root for all the variables.For example, given the following file structure:
mkdocs.yaml
:1_foo.yaml
:The user can call the variable
bar
as:1_foo.md
:Up to now, the user would have to call the variable with
{{1_foo.bar}}
, which raises ajinja2.exceptions.TemplateSyntaxError
, since the name1_foo
is not according to the Python variable naming restrictions.One unintended effect of this modification is that the user is now able to call all entries in
self.mkdocsConfig
. If the user declares a file with a name which is the same as a pre-existing key onself.mkdocsConfig
, this is not a problem: due to the order in which the dictionaries are merged on line 109, the entries insideself.mkdocsConfig.get("extra")
overwrite whatever was inself.mkdocsConfig
.This solves #34.