Skip to content

Please allow inclusion of jinja2 extensions. #272

@wwarriner

Description

@wwarriner

Hi there, enjoying use of the plugin. I anticipate this plugin will be a key part in making our documentation more concise and friendly.

I find myself frustrated by Jinja's ongoing challenges with consistent include indentation (#178). So, from the linked issue, I installed and began using this extension: https://github.com/stereobutter/jinja2_workarounds. The extension made it possible to have markdown-consistent indentation of template structure in the containing file.

To include the extension in the mkdocs-macros plugin I added the following to mkdocs.yml.

plugins:
  - macros:
      ...
      j2_extensions:
        - jinja2_workarounds.MultiLineInclude

This works exactly as expected, except that mkdocs now emits a warning on build because the option is "Unrecognised". We rely on the --strict flag to catch common issues from contributors, and don't want to turn it off, so we can't currently use the Jinja indentation extension in our documentation.

WARNING -  Config value 'plugins': Plugin 'macros' option 'j2_extensions': Unrecognised configuration name: j2_extensions

I see at line 119 in plugin.py the mkdocs-macros config schema is defined. Can the entry (j2_extensions, J2_STRING) please be added to the schema to allow users of your plugin to make use of Jinja extensions?

Thank you for your consideration, and for the awesome plugin!

Metadata

Metadata

Assignees

No one assigned

    Labels

    AnnoyanceSomething annoying (not a bug)fixedA fix has been submittedgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions