Skip to content

Commit 70dee38

Browse files
committed
Switched warning message to print to stderr
1 parent b78109b commit 70dee38

2 files changed

Lines changed: 26 additions & 18 deletions

File tree

material/plugins/__init__.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,20 @@
1919
# IN THE SOFTWARE.
2020

2121
from os import getenv
22+
from sys import stderr
2223
from colorama import Fore, Style
2324

2425
# Silence this warning with NO_MKDOCS_2_WARNING=1
2526
if not getenv("NO_MKDOCS_2_WARNING"):
26-
print("")
27-
print(f"{Fore.RED} │ ⚠ WARNING – MkDocs 2.0 is incompatible with Material for MkDocs{Style.RESET_ALL}")
28-
print(f"{Fore.RED}{Style.RESET_ALL}")
29-
print(f"{Fore.RED}{Style.RESET_ALL} MkDocs 1.x is unmaintained. We recommend switching to Zensical, our")
30-
print(f"{Fore.RED}{Style.RESET_ALL} new static site generator, as soon as possible. We're providing an")
31-
print(f"{Fore.RED}{Style.RESET_ALL} analysis of the situation in this article:")
32-
print(f"{Fore.RED}{Style.RESET_ALL} ")
33-
print(f"{Fore.RED}{Style.RESET_ALL} \033[4mhttps://squidfunk.github.io/mkdocs-material/blog/2026/02/18/mkdocs-2.0/{Style.RESET_ALL}")
34-
print(f"{Style.RESET_ALL}")
27+
print(
28+
"\n"
29+
f"{Fore.RED} │ ⚠ WARNING – MkDocs 2.0 is incompatible with Material for MkDocs{Style.RESET_ALL}\n"
30+
f"{Fore.RED}{Style.RESET_ALL}\n"
31+
f"{Fore.RED}{Style.RESET_ALL} MkDocs 1.x is unmaintained. We recommend switching to Zensical, our\n"
32+
f"{Fore.RED}{Style.RESET_ALL} new static site generator, as soon as possible. We're providing an\n"
33+
f"{Fore.RED}{Style.RESET_ALL} analysis of the situation in this article:\n"
34+
f"{Fore.RED}{Style.RESET_ALL} \n"
35+
f"{Fore.RED}{Style.RESET_ALL} \033[4mhttps://squidfunk.github.io/mkdocs-material/blog/2026/02/18/mkdocs-2.0/{Style.RESET_ALL}\n"
36+
f"{Style.RESET_ALL}",
37+
file=stderr
38+
)

src/plugins/__init__.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,20 @@
1919
# IN THE SOFTWARE.
2020

2121
from os import getenv
22+
from sys import stderr
2223
from colorama import Fore, Style
2324

2425
# Silence this warning with NO_MKDOCS_2_WARNING=1
2526
if not getenv("NO_MKDOCS_2_WARNING"):
26-
print("")
27-
print(f"{Fore.RED} │ ⚠ WARNING – MkDocs 2.0 is incompatible with Material for MkDocs{Style.RESET_ALL}")
28-
print(f"{Fore.RED}{Style.RESET_ALL}")
29-
print(f"{Fore.RED}{Style.RESET_ALL} MkDocs 1.x is unmaintained. We recommend switching to Zensical, our")
30-
print(f"{Fore.RED}{Style.RESET_ALL} new static site generator, as soon as possible. We're providing an")
31-
print(f"{Fore.RED}{Style.RESET_ALL} analysis of the situation in this article:")
32-
print(f"{Fore.RED}{Style.RESET_ALL} ")
33-
print(f"{Fore.RED}{Style.RESET_ALL} \033[4mhttps://squidfunk.github.io/mkdocs-material/blog/2026/02/18/mkdocs-2.0/{Style.RESET_ALL}")
34-
print(f"{Style.RESET_ALL}")
27+
print(
28+
"\n"
29+
f"{Fore.RED} │ ⚠ WARNING – MkDocs 2.0 is incompatible with Material for MkDocs{Style.RESET_ALL}\n"
30+
f"{Fore.RED}{Style.RESET_ALL}\n"
31+
f"{Fore.RED}{Style.RESET_ALL} MkDocs 1.x is unmaintained. We recommend switching to Zensical, our\n"
32+
f"{Fore.RED}{Style.RESET_ALL} new static site generator, as soon as possible. We're providing an\n"
33+
f"{Fore.RED}{Style.RESET_ALL} analysis of the situation in this article:\n"
34+
f"{Fore.RED}{Style.RESET_ALL} \n"
35+
f"{Fore.RED}{Style.RESET_ALL} \033[4mhttps://squidfunk.github.io/mkdocs-material/blog/2026/02/18/mkdocs-2.0/{Style.RESET_ALL}\n"
36+
f"{Style.RESET_ALL}",
37+
file=stderr
38+
)

0 commit comments

Comments
 (0)