While writing my own plugin mkdocs-pom-parser-plugin I noticed it was specifically not working when it was together with yours. It took me a while to understand the issue, but in essence the code below:
Should be converted to something like this (I haven't tested it in your repo, but works in mine):
def on_page_markdown(self, markdown, config, **kwargs):
# log.debug("pom on_page_markdown[markdown: %s]", markdown)
# Do not use Template because it will remove all unknown template variables and break the chain
# if there are other plugins hooked to on_page_markdown event.
# https://stackoverflow.com/questions/20120957/jinja-leave-template-tags-after-render
# md_template = Template(markdown)
env = jinja2.Environment(undefined=jinja2.DebugUndefined)
md_template = env.from_string(markdown)
return md_template.render(**config.get("extra"))
Since you are using Template, all other plugins which are also hooked to on_page_markdown will receive a sanitized template string which will not contain any of the unknown variables and thus resulting in head scratches and wondering why nothing shows when all tests are actually passing. :)
Hi,
While writing my own plugin mkdocs-pom-parser-plugin I noticed it was specifically not working when it was together with yours. It took me a while to understand the issue, but in essence the code below:
https://github.com/rosscdh/mkdocs-markdownextradata-plugin/blob/9af2957fde9a99efa40faea67097c3c43d85cc98/markdownextradata/plugin.py#L91-L95
Should be converted to something like this (I haven't tested it in your repo, but works in mine):
Since you are using
Template
, all other plugins which are also hooked toon_page_markdown
will receive a sanitized template string which will not contain any of the unknown variables and thus resulting in head scratches and wondering why nothing shows when all tests are actually passing. :)https://stackoverflow.com/questions/20120957/jinja-leave-template-tags-after-render