Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions properdocs/replacement_warning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand All @@ -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.


Expand Down
Loading