rosscdh / mkdocs-markdownextradata-plugin

A MkDocs plugin that injects the mkdocs.yml extra variables into the markdown template
MIT License
83 stars 18 forks source link

Preprocess during on_page_read_source #20

Closed miffels closed 4 years ago

miffels commented 4 years ago

Change preprocessor to apply during on_page_read_source, not on_page_markdown. It uses the mechanism used by default MkDocs pages, but passing it through the Jinja preprocessor before return it to the Page object.

Alas, I am not sure how I can test nav generation in with the test framework. If you can give me a pointer or two, I could validate that the nav contains the interpolated string instead of the template var.

Fixes #19

rosscdh commented 4 years ago

@miffels thanks for the PR I've modified the test to cater to your raised issue in #19

rosscdh commented 4 years ago

Can you review that change and if you agree if solves your issue ill merge and release :)