Module

orchestration.incremental.cleanup

Cleanup utilities for incremental builds.

Handles cleanup of deleted source files and their corresponding output files. Ensures stale content is removed when source files are deleted.

Key Concepts:

  • Source file tracking: Track which source files produced which output
  • Output cleanup: Remove output when source is deleted
  • Autodoc cleanup: Handle autodoc pages when Python source files deleted

Related Modules:

  • bengal.cache.build_cache: Build cache with output_sources mapping
  • bengal.orchestration.incremental: Incremental build coordination

Functions

cleanup_deleted_files 2 int
Clean up output files for deleted source files. Checks cache for source files …
def cleanup_deleted_files(site: Site, cache: BuildCache) -> int

Clean up output files for deleted source files.

Checks cache for source files that no longer exist and deletes their corresponding output files. This prevents stale content from remaining in the output directory after source deletion.

Parameters
Name Type Description
site Site

Site instance for output directory access

cache BuildCache

BuildCache instance with source mappings

Returns
int
_cleanup_deleted_autodoc_sources 2 None
Clean up autodoc pages when their source files are deleted. Checks tracked aut…
def _cleanup_deleted_autodoc_sources(site: Site, cache: BuildCache) -> None

Clean up autodoc pages when their source files are deleted.

Checks tracked autodoc source files and removes corresponding output when the source no longer exists. This prevents stale autodoc pages from remaining when Python/OpenAPI source files are deleted.

Parameters
Name Type Description
site Site

Site instance for output directory access

cache BuildCache

BuildCache instance with autodoc mappings