Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow third-party plugins to override core plugins #2591

Merged
merged 2 commits into from Oct 7, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion mkdocs/plugins.py
Expand Up @@ -26,7 +26,15 @@ def get_plugins():

plugins = importlib_metadata.entry_points(group='mkdocs.plugins')

return {plugin.name: plugin for plugin in plugins}
# Allow third-party plugins to override core plugins
pluginmap = {}
for plugin in plugins:
if plugin.name in pluginmap and "mkdocs.contrib" in plugin.value:
squidfunk marked this conversation as resolved.
Show resolved Hide resolved
continue

pluginmap[plugin.name] = plugin

return pluginmap


class BasePlugin:
Expand Down