Skip to content

Run post-build after all other plugins#23

Merged
oprypin merged 1 commit intooprypin:masterfrom
percevalw:patch-1
Apr 27, 2023
Merged

Run post-build after all other plugins#23
oprypin merged 1 commit intooprypin:masterfrom
percevalw:patch-1

Conversation

@percevalw
Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Owner

@oprypin oprypin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@oprypin oprypin merged commit 10034c5 into oprypin:master Apr 27, 2023
@oprypin
Copy link
Copy Markdown
Owner

oprypin commented Apr 27, 2023

And released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants