From cc5afd0f2fa3a04bf5858845aed966f79a7adc4f Mon Sep 17 00:00:00 2001 From: Xianpeng Shen Date: Fri, 6 Nov 2026 06:56:27 +0000 Subject: [PATCH] Remove the install notice printed on every build The banner told users who already had mkdocs-ng-material to install it, and 9.8.0 linked to the old documentation address. --- docs/changelog/index.md | 3 +++ material/templates/__init__.py | 32 -------------------------------- src/templates/__init__.py | 32 -------------------------------- 3 files changed, 3 insertions(+), 64 deletions(-) diff --git a/docs/changelog/index.md b/docs/changelog/index.md index e8a675e85b..4b127eeedf 100644 --- a/docs/changelog/index.md +++ b/docs/changelog/index.md @@ -8,6 +8,9 @@ of pages that didn't change instead of parsing their HTML again (needs mkdocs-ng 1.11). With 1,000 pages, an edited page shows up after 4.1 seconds instead of 5.9 +- Builds no longer print the "Notice from MkDocs NG Material" banner, which + asked users who already had mkdocs-ng-material to install it and linked to + the old documentation address ### 9.8.0 November 1, 2026 { id="9.8.0" } diff --git a/material/templates/__init__.py b/material/templates/__init__.py index a1ac0bb698..cf4e7db904 100644 --- a/material/templates/__init__.py +++ b/material/templates/__init__.py @@ -17,35 +17,3 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. - -import os -import sys - -from colorama import Fore, Style -from pathlib import Path -from sys import stderr - -# Check if we're running MkDocs (or mkdocs-ng). This theme is now maintained -# as part of the mkdocs-ng ecosystem. The CLI command remains `mkdocs`. -def is_mkdocs(): - path = Path(sys.argv[0]) - return path.name in ("mkdocs", "mkdocs.exe") or ( - path.name == "__main__.py" and path.parent.name == "mkdocs" - ) - -# Print a notice about mkdocs-ng maintainership (once per session) -if is_mkdocs() and not os.getenv("NO_MKDOCS_NG_NOTICE"): - print( - "\n" - f"{Fore.GREEN} │ ℹ Notice from MkDocs NG Material{Style.RESET_ALL}\n" - f"{Fore.GREEN} │{Style.RESET_ALL}\n" - f"{Fore.GREEN} │{Style.RESET_ALL} This theme is now maintained as part of MkDocs NG.\n" - f"{Fore.GREEN} │{Style.RESET_ALL} Install: pip install mkdocs-ng-material\n" - f"{Fore.GREEN} │{Style.RESET_ALL} Docs: https://material.mkdocs-ng.org/\n" - f"{Fore.GREEN} │{Style.RESET_ALL} GitHub: https://github.com/mkdocs-ng/mkdocs-material\n" - f"{Style.RESET_ALL}", - file=stderr - ) - -# Disable for subsequent imports -os.environ["NO_MKDOCS_NG_NOTICE"] = "true" diff --git a/src/templates/__init__.py b/src/templates/__init__.py index a1ac0bb698..cf4e7db904 100644 --- a/src/templates/__init__.py +++ b/src/templates/__init__.py @@ -17,35 +17,3 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. - -import os -import sys - -from colorama import Fore, Style -from pathlib import Path -from sys import stderr - -# Check if we're running MkDocs (or mkdocs-ng). This theme is now maintained -# as part of the mkdocs-ng ecosystem. The CLI command remains `mkdocs`. -def is_mkdocs(): - path = Path(sys.argv[0]) - return path.name in ("mkdocs", "mkdocs.exe") or ( - path.name == "__main__.py" and path.parent.name == "mkdocs" - ) - -# Print a notice about mkdocs-ng maintainership (once per session) -if is_mkdocs() and not os.getenv("NO_MKDOCS_NG_NOTICE"): - print( - "\n" - f"{Fore.GREEN} │ ℹ Notice from MkDocs NG Material{Style.RESET_ALL}\n" - f"{Fore.GREEN} │{Style.RESET_ALL}\n" - f"{Fore.GREEN} │{Style.RESET_ALL} This theme is now maintained as part of MkDocs NG.\n" - f"{Fore.GREEN} │{Style.RESET_ALL} Install: pip install mkdocs-ng-material\n" - f"{Fore.GREEN} │{Style.RESET_ALL} Docs: https://material.mkdocs-ng.org/\n" - f"{Fore.GREEN} │{Style.RESET_ALL} GitHub: https://github.com/mkdocs-ng/mkdocs-material\n" - f"{Style.RESET_ALL}", - file=stderr - ) - -# Disable for subsequent imports -os.environ["NO_MKDOCS_NG_NOTICE"] = "true"