diff --git a/mkdocs_enumerate_headings_plugin/plugin.py b/mkdocs_enumerate_headings_plugin/plugin.py index b4ff1dc..482f52c 100644 --- a/mkdocs_enumerate_headings_plugin/plugin.py +++ b/mkdocs_enumerate_headings_plugin/plugin.py @@ -1,7 +1,9 @@ # coding=utf-8 + import logging +from collections import OrderedDict from mkdocs.config import config_options from mkdocs.plugins import BasePlugin from mkdocs_enumerate_headings_plugin.html_page import HTMLPage @@ -37,9 +39,9 @@ def on_config(self, config, **kwargs): # MkDocs executes plugins in order they are defined # So we can do some checks on other plugins defined. - plugins = [*dict(config["plugins"])] + plugins = [*OrderedDict(config["plugins"])] - def check_position(plugin): + def check_position(plugin, plugins): if plugin in plugins: if plugins.index("enumerate-headings") < plugins.index(plugin): logging.warning( @@ -63,7 +65,7 @@ def check_position(plugin): "mkdocs-simple-hooks", ] for p in check_plugins: - check_position(p) + check_position(p, plugins) return config