Skip to content

Commit cff4a75

Browse files
committed
Fixed deprecation warning in tags plugin
1 parent edcc536 commit cff4a75

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

material/plugins/tags/plugin.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ def _get_tags_file(self, files, path):
128128
log.error(f"Tags file '{path}' does not exist.")
129129
sys.exit(1)
130130

131-
# Add tags file to files
131+
# Add tags file to files - note: since MkDoc 1.6, not removing the
132+
# file before adding it to the end will trigger a deprecation warning
133+
# The new tags plugin does not require this hack, so we're just going
134+
# to live with it until the new tags plugin is released.
135+
files.remove(file)
132136
files.append(file)
133137
return file
134138

src/plugins/tags/plugin.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ def _get_tags_file(self, files, path):
128128
log.error(f"Tags file '{path}' does not exist.")
129129
sys.exit(1)
130130

131-
# Add tags file to files
131+
# Add tags file to files - note: since MkDoc 1.6, not removing the
132+
# file before adding it to the end will trigger a deprecation warning
133+
# The new tags plugin does not require this hack, so we're just going
134+
# to live with it until the new tags plugin is released.
135+
files.remove(file)
132136
files.append(file)
133137
return file
134138

0 commit comments

Comments
 (0)