diff --git a/properdocs/replacement_warning.py b/properdocs/replacement_warning.py index 30a42236..609e691e 100644 --- a/properdocs/replacement_warning.py +++ b/properdocs/replacement_warning.py @@ -31,6 +31,8 @@ To avoid these risks, switch to *ProperDocs*, a continuation of MkDocs 1.x and a drop-in replacement that supports your current MkDocs setup. Simply install it with `pip install properdocs` and build your site with `properdocs build` instead of the MkDocs equivalents. +Alternatively, to just skip this warning in the future, you can set the environment variable `DISABLE_MKDOCS_2_WARNING=true`. + For more info visit https://github.com/ProperDocs/properdocs/discussions/33 and https://properdocs.org/ (This warning was initiated by one of the plugins that you depend on.) @@ -44,14 +46,10 @@ def setup(): return if is_running_from_mkdocs(): - # Allow to silence this warning with NO_MKDOCS_2_WARNING=true - if os.environ.get('NO_MKDOCS_2_WARNING', '').lower() != 'true': + # Allow to silence this warning with DISABLE_MKDOCS_2_WARNING=true + if os.environ.get('DISABLE_MKDOCS_2_WARNING', '').lower() != 'true': print(colorize_message(_warning_message), file=sys.stderr) # noqa: T201 - # Prevent warnings from the theme that already uses this environment variable. - # That warning does not apply to ProperDocs. - os.environ['NO_MKDOCS_2_WARNING'] = 'true' - _warning_message = '' # Disable all activations other than the first one.