Module

utils.build_stats

Build statistics display with colorful output and ASCII art.

Classes

BuildWarning dataclass
A build warning or error.
1

A build warning or error.

Attributes

Name Type Description
file_path str
message str
warning_type str

Methods 1

short_path property
Get shortened path for display.
str
def short_path(self) -> str

Get shortened path for display.

Returns

str

BuildStats dataclass
Container for build statistics.
8

Container for build statistics.

Attributes

Name Type Description
total_pages int
regular_pages int
generated_pages int
tag_pages int
archive_pages int
pagination_pages int
total_assets int
total_sections int
taxonomies_count int
build_time_ms float
parallel bool
incremental bool
skipped bool
total_directives int
directives_by_type dict[str, int]
discovery_time_ms float
taxonomy_time_ms float
rendering_time_ms float
assets_time_ms float
postprocess_time_ms float
health_check_time_ms float
memory_rss_mb float
memory_heap_mb float
memory_peak_mb float
cache_hits int
cache_misses int
time_saved_ms float
cache_bypass_hits int
cache_bypass_misses int
menu_time_ms float
related_posts_time_ms float
fonts_time_ms float
output_dir str | None
strict_mode bool
changed_outputs list[str] | None
health_report HealthReport | None
warnings list[Any]
template_errors list[Any]

Methods 8

has_errors property
Check if build has any errors.
bool
def has_errors(self) -> bool

Check if build has any errors.

Returns

bool

syntax_errors property
Get template errors that are syntax errors. Filters template_errors to return …
list[Any]
def syntax_errors(self) -> list[Any]

Get template errors that are syntax errors.

Filters template_errors to return only those with error_type == "syntax". These are typically Jinja2 TemplateSyntaxError instances (missing endif, unclosed tags, etc.).

Returns

list[Any]

List of TemplateRenderError objects with syntax errors.

not_found_errors property
Get template errors that are "not found" errors. Filters template_errors to re…
list[Any]
def not_found_errors(self) -> list[Any]

Get template errors that are "not found" errors.

Filters template_errors to return only those with error_type == "not_found". These occur when a page requests a template that doesn't exist in any template directory.

Returns

list[Any]

List of TemplateRenderError objects for missing templates.

warnings_by_type property
Group warnings by type.
dict[str, list[Buil…
def warnings_by_type(self) -> dict[str, list[BuildWarning]]

Group warnings by type.

Returns

dict[str, list[BuildWarning]]

add_warning
Add a warning to the build.
3 None
def add_warning(self, file_path: str, message: str, warning_type: str = 'other') -> None

Add a warning to the build.

Parameters 3
file_path str
message str
warning_type str
add_template_error
Add a rich template error.
1 None
def add_template_error(self, error: Any) -> None

Add a rich template error.

Parameters 1
error Any
add_directive
Track a directive usage.
1 None
def add_directive(self, directive_type: str) -> None

Track a directive usage.

Parameters 1
directive_type str
to_dict
Convert stats to dictionary.
0 dict[str, Any]
def to_dict(self) -> dict[str, Any]

Convert stats to dictionary.

Returns

dict[str, Any]

Functions

format_time
Format milliseconds for display.
1 str
def format_time(ms: float) -> str

Format milliseconds for display.

Parameters 1

Name Type Default Description
ms float

Returns

str

display_warnings
Display grouped warnings and errors.
1 None
def display_warnings(stats: BuildStats) -> None

Display grouped warnings and errors.

Parameters 1

Name Type Default Description
stats BuildStats

Build statistics with warnings

display_simple_build_stats
Display simple build statistics for writers. Clean, minimal output focused on success/failure and …
2 None
def display_simple_build_stats(stats: BuildStats, output_dir: str | None = None) -> None

Display simple build statistics for writers.

Clean, minimal output focused on success/failure and critical issues only. Perfect for content authors who just want to know "did it work?"

Parameters 2

Name Type Default Description
stats BuildStats

Build statistics to display

output_dir str | None None

Output directory path to display

display_build_stats
Display build statistics in a colorful table.
3 None
def display_build_stats(stats: BuildStats, show_art: bool = True, output_dir: str | None = None) -> None

Display build statistics in a colorful table.

Parameters 3

Name Type Default Description
stats BuildStats

Build statistics to display

show_art bool True

Whether to show ASCII art

output_dir str | None None

Output directory path to display

show_building_indicator
Show a building indicator (minimal - header is shown by build orchestrator).
1 None
def show_building_indicator(text: str = 'Building') -> None

Show a building indicator (minimal - header is shown by build orchestrator).

Parameters 1

Name Type Default Description
text str 'Building'
show_error
Show an error message with mouse emoji (errors that Bengal needs to catch!).
2 None
def show_error(message: str, show_art: bool = True) -> None

Show an error message with mouse emoji (errors that Bengal needs to catch!).

Parameters 2

Name Type Default Description
message str
show_art bool True
show_welcome
Show welcome banner with Bengal cat mascot.
0 None
def show_welcome() -> None

Show welcome banner with Bengal cat mascot.

show_clean_success
Show clean success message using CLI output system. Note: This is now only used for --force mode (…
1 None
def show_clean_success(output_dir: str) -> None

Show clean success message using CLI output system.

Note: This is now only used for --force mode (when there's no prompt). Regular clean uses inline success message after prompt confirmation.

Parameters 1

Name Type Default Description
output_dir str
display_template_errors
Display all collected template errors.
1 None
def display_template_errors(stats: BuildStats) -> None

Display all collected template errors.

Parameters 1

Name Type Default Description
stats BuildStats

Build statistics with template errors