Skip to content

Commit

Permalink
fix bug in py3.5 where ordereddict was assumed
Browse files Browse the repository at this point in the history
  • Loading branch information
timvink committed Sep 8, 2020
1 parent cc678d5 commit fc25385
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mkdocs_enumerate_headings_plugin/plugin.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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

Expand Down

0 comments on commit fc25385

Please sign in to comment.