diff --git a/graphify/watch.py b/graphify/watch.py index a967b5d8..0b7bd956 100644 --- a/graphify/watch.py +++ b/graphify/watch.py @@ -70,6 +70,13 @@ def _rebuild_code(watch_path: Path, *, follow_symlinks: bool = False, force: boo detected = detect(watch_path, follow_symlinks=follow_symlinks) code_files = [Path(f) for f in detected['files']['code']] + # Include document files that have AST extractors (e.g. .md, .mdx) + from graphify.extract import _get_extractor + for doc_file in detected['files'].get('document', []): + p = Path(doc_file) + if _get_extractor(p) is not None: + code_files.append(p) + if not code_files: print("[graphify watch] No code files found - nothing to rebuild.") return False