Skip to content

Commit b6481ce

Browse files
authored
Change the environment variable that is used to suppress the nag message (#53)
The commit squidfunk/mkdocs-material@51d9b76 made this environment unusable - it's always set and there's no reasonable way to detect whether it was actually set on the command line. Users will unfortunately run into a new nuisance even if they previously set our variable. --- Also, add a direct mention how to suppress the warning. Now that we've had to change this variable once, it's nice to give users a direct way to get rid of this.
1 parent 3cd9b08 commit b6481ce

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

properdocs/replacement_warning.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
To avoid these risks, switch to *ProperDocs*, a continuation of MkDocs 1.x and a drop-in replacement that supports your current MkDocs setup.
3232
Simply install it with `pip install properdocs` and build your site with `properdocs build` instead of the MkDocs equivalents.
3333
34+
Alternatively, to just skip this warning in the future, you can set the environment variable `DISABLE_MKDOCS_2_WARNING=true`.
35+
3436
For more info visit https://github.com/ProperDocs/properdocs/discussions/33 and https://properdocs.org/
3537
3638
(This warning was initiated by one of the plugins that you depend on.)
@@ -44,14 +46,10 @@ def setup():
4446
return
4547

4648
if is_running_from_mkdocs():
47-
# Allow to silence this warning with NO_MKDOCS_2_WARNING=true
48-
if os.environ.get('NO_MKDOCS_2_WARNING', '').lower() != 'true':
49+
# Allow to silence this warning with DISABLE_MKDOCS_2_WARNING=true
50+
if os.environ.get('DISABLE_MKDOCS_2_WARNING', '').lower() != 'true':
4951
print(colorize_message(_warning_message), file=sys.stderr) # noqa: T201
5052

51-
# Prevent warnings from the theme that already uses this environment variable.
52-
# That warning does not apply to ProperDocs.
53-
os.environ['NO_MKDOCS_2_WARNING'] = 'true'
54-
5553
_warning_message = '' # Disable all activations other than the first one.
5654

5755

0 commit comments

Comments
 (0)