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.
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 theon_files
event).While it is still possible to place the plugin at the top of the
mkdocs
plugins list to solve theon_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 theevent_priority
decorator.This PR proposes to decorate the
on_post_build
method so that it always executes last.