Skip to content

Commit

Permalink
fix: Fixed warning related to deprecated mkdocs logging function (#264)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas D'Hondt <[email protected]>
  • Loading branch information
thdhondt and Thomas D'Hondt authored Aug 23, 2024
1 parent da9f5f1 commit 2797caa
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/mkdocs_bibtex/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,24 @@
from functools import lru_cache
from itertools import groupby
from pathlib import Path
from packaging.version import Version

import mkdocs
import pypandoc
from mkdocs.utils import warning_filter

from pybtex.backends.markdown import Backend as MarkdownBackend
from pybtex.database import BibliographyData
from pybtex.style.formatting.plain import Style as PlainStyle


# Grab a logger
log = logging.getLogger("mkdocs.plugins.mkdocs-bibtex")
log.addFilter(warning_filter)

# Add the warning filter only if the version is lower than 1.2
# Filter doesn't do anything since that version
MKDOCS_LOG_VERSION = '1.2'
if Version(mkdocs.__version__) < Version(MKDOCS_LOG_VERSION):
from mkdocs.utils import warning_filter
log.addFilter(warning_filter)


def format_simple(entries):
Expand Down

0 comments on commit 2797caa

Please sign in to comment.