diff --git a/mermaid2/util.py b/mermaid2/util.py index ce2e9b0..db54fa4 100644 --- a/mermaid2/util.py +++ b/mermaid2/util.py @@ -3,16 +3,22 @@ """ import os import requests -import logging +import logging +from packaging.version import Version +import mkdocs -from mkdocs.utils import warning_filter # ------------------- # Logging # ------------------- log = logging.getLogger("mkdocs.plugins." + __name__) -log.addFilter(warning_filter) + +MKDOCS_LOG_VERSION = '1.2' +if Version(mkdocs.__version__) < Version(MKDOCS_LOG_VERSION): + # filter doesn't do anything since that version + from mkdocs.utils import warning_filter + log.addFilter(warning_filter) MERMAID_LABEL = "MERMAID2 -" # plugin's signature label def info(*args) -> str: diff --git a/setup.py b/setup.py index 60c54f4..6be3b26 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages -VERSION = '1.0.5' +VERSION = '1.0.6' # required if you want to run tests # pip install 'mkdocs-mermaid2-plugin[test]' @@ -15,8 +15,8 @@ def readme(): LONG_DESCRIPTION = ( - "A mkdocs plugin that interprets mermaid graphs in the markdown file." - "To install, please follow instructions in the readme file." + "An Mkdocs plugin that renders Mermaid graphs in the markdown file. " + "To install, please follow instructions in the Readme file.\n" "This is a fork of the Pugong Liu's excellent project, " "which is no longer maintained." )