diff --git a/README.md b/README.md index 4e0bd1d..7b66e9e 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,11 @@ plugins: # keep unicode characters allow_unicode: no - # skip files entirely + # skip files entirely (supports Unix shell-style wildcards) skip_files: - credits.md - coverage.md + - reference/* # whether to only check in strict mode strict_only: yes diff --git a/docs/known_words.txt b/docs/known_words.txt index 1aa860f..846cb43 100644 --- a/docs/known_words.txt +++ b/docs/known_words.txt @@ -29,4 +29,7 @@ dataclass ahrens dev fr -uv \ No newline at end of file +uv +codespell +mkdocs_spellcheck +symspellpy \ No newline at end of file diff --git a/src/mkdocs_spellcheck/plugin.py b/src/mkdocs_spellcheck/plugin.py index 7e8d666..ae56b39 100644 --- a/src/mkdocs_spellcheck/plugin.py +++ b/src/mkdocs_spellcheck/plugin.py @@ -5,6 +5,7 @@ from __future__ import annotations +import fnmatch from pathlib import Path from typing import TYPE_CHECKING, Any @@ -129,7 +130,7 @@ def on_page_content(self, html: str, page: Page, **kwargs: Any) -> None: # noqa page: The page instance. **kwargs: Additional arguments passed by MkDocs. """ - if self.run and page.file.src_path not in self.skip_files: + if self.run and not any(fnmatch.fnmatch(page.file.src_path, pattern) for pattern in self.skip_files): words = get_words( html, known_words=self.known_words,