From b313279af757c3b202f01179219221069709bc85 Mon Sep 17 00:00:00 2001 From: Samit <285365963@qq.com> Date: Wed, 11 Mar 2026 17:32:12 +0800 Subject: [PATCH] [skip ci][Docs] doc fix for example snippets (#1811) Signed-off-by: samithuang <285365963@qq.com> Signed-off-by: Samit <285365963@qq.com> --- docs/mkdocs/hooks/generate_examples.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/mkdocs/hooks/generate_examples.py b/docs/mkdocs/hooks/generate_examples.py index 4e840280b..b4c928936 100644 --- a/docs/mkdocs/hooks/generate_examples.py +++ b/docs/mkdocs/hooks/generate_examples.py @@ -132,9 +132,19 @@ class Example: ".dat", ".db", ".sqlite", # Data files + ".pyc", + ".pyo", + ".pyd", # Python compiled + ".npy", + ".npz", + ".pkl", + ".pickle", # Serialized data } + excluded_dirs = {"__pycache__", ".git", "node_modules", ".tox", ".mypy_cache"} def is_other_file(file: Path) -> bool: + if any(part in excluded_dirs for part in file.parts): + return False return file.is_file() and file != self.main_file and file.suffix.lower() not in binary_extensions return [file for file in self.path.rglob("*") if is_other_file(file)]