oprypin / mkdocs-gen-files

MkDocs plugin to programmatically generate documentation pages during the build
https://oprypin.github.io/mkdocs-gen-files
MIT License
98 stars 8 forks source link

Run post-build after all other plugins #23

Closed percevalw closed 1 year ago

percevalw commented 1 year ago

Description

mkdocs-gen-files deletes its temporary directory during the post_build event, but some other plugins like mkdocs-i18n use the files generated during this event as well, but also require them to be generated beforehand (during the on_files event).

While it is still possible to place the plugin at the top of the mkdocs plugins list to solve the on_files dependency, this also results in the cleanup being run first. Fortunately, as of mkdocs 1.4, we can order the execution of events with the event_priority decorator.

This PR proposes to decorate the on_post_build method so that it always executes last.

oprypin commented 1 year ago

And released.