Skip to content

Commit f38f502

Browse files
authored
Warn when this plugin is being used from the mkdocs executable (#2)
And prevent possible future versions of MkDocs. As described in ProperDocs/properdocs#33
1 parent 92979c5 commit f38f502

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Pin to lowest versions
4040
if: matrix.versions == 'minimal'
4141
run: |
42-
sed -i -E 's/#min //; s/\b >=([0-9])/ ==\1/' pyproject.toml
42+
sed -i -E -e '/properdocs >=/d' -e 's/#min //; s/\b >=([0-9])/ ==\1/' pyproject.toml
4343
- name: Install Hatch
4444
run: |
4545
pip install hatch

‎mkdocs_redirects/plugin.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
from mkdocs.plugins import BasePlugin
1313
from mkdocs.structure.files import File
1414

15+
try:
16+
import properdocs.replacement_warning
17+
18+
# Warn when this plugin is being used from the mkdocs executable.
19+
properdocs.replacement_warning.setup()
20+
except ImportError:
21+
pass
22+
23+
1524
log = logging.getLogger("mkdocs.plugin.redirects")
1625

1726

‎pyproject.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ classifiers = [
3434
dynamic = ["version"]
3535
requires-python = ">=3.10"
3636
dependencies = [
37-
"mkdocs >=1.2",
37+
"mkdocs >=1.2, <=1.6.1",
38+
"properdocs >=1.6.5",
3839
#min "jinja2 >=2.10.2",
3940
#min "markupsafe >=2.0.1",
4041
]

0 commit comments

Comments
 (0)