Skip to content

chore: remove orphaned example files and add reference check#222

Merged
yaythomas merged 1 commit into
mainfrom
chore/remove-orphaned-examples
Jul 14, 2026
Merged

chore: remove orphaned example files and add reference check#222
yaythomas merged 1 commit into
mainfrom
chore/remove-orphaned-examples

Conversation

@yaythomas

Copy link
Copy Markdown
Contributor

Summary

Closes #221.

Removes the 775 files under examples/ that no docs page includes, and adds a CI guard so orphans cannot accumulate again.

  • Deleted: 775 orphaned example files (262 Java, 256 Python, 257 TypeScript). Orphans were computed at HEAD as all files under examples/ minus the set referenced by --8<-- includes in docs/. Every include in the repo uses the single quoted full-file syntax, all 403 included paths exist on disk, and nothing in CI, scripts, or config consumes examples/, so the computation has no blind spots. Files remain recoverable from git history.
  • Added scripts/check_example_refs.py: fails when an example file is unreferenced (orphan) or an include points at a missing file (broken include). Follows the existing vendor_*.py --check pattern.
  • Wired into .github/workflows/docs.yml alongside the vendored-asset checks.

Testing

  • python3 scripts/check_example_refs.pyOK: 403 example files, all referenced; no broken includes.
  • Negative test: adding a stray file under examples/ makes the script report it and exit 1.
  • zensical build --cleanNo issues found, zero warnings; no rendered page lost content since only unreferenced files were deleted.

Remove 775 files under examples/ that no docs page includes. They are
leftovers from an earlier docs structure and never render on the
published site, but they live in a public repo where contributors and
AI assistants can pick up stale or incorrect patterns. Some contain
invalid code, for example a wait_for_callback call that passes a
callback ID where the submitter callable belongs.

Add scripts/check_example_refs.py and run it in CI so an example file
that no docs page references, or an include that points at a missing
file, fails the build.

Closes #221
@yaythomas yaythomas merged commit a521170 into main Jul 14, 2026
4 checks passed
@yaythomas yaythomas deleted the chore/remove-orphaned-examples branch July 14, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

examples/: 775 of 1,176 example files are orphaned, some contain incorrect code

3 participants