Module

debug.models

Data models for page explanation.

Defines dataclasses for representing different aspects of page building:

source info, template chains, dependencies, shortcodes, cache status, etc.

All models are designed to be JSON-serializable for potential export and are display-friendly with human-readable formatting.

Classes

SourceInfo dataclass
Information about the source file.
1

Information about the source file.

Attributes

Name Type Description
path Path
size_bytes int
line_count int
modified datetime | None
encoding str

Methods 1

size_human property
Human-readable file size.
str
def size_human(self) -> str

Human-readable file size.

Returns

str

TemplateInfo dataclass
Information about a template in the chain.
0

Information about a template in the chain.

Attributes

Name Type Description
name str
source_path Path | None
theme str | None
extends str | None
includes list[str]
DependencyInfo dataclass
Dependencies for a page.
0

Dependencies for a page.

Attributes

Name Type Description
content list[str]
templates list[str]
data list[str]
assets list[str]
includes list[str]
ShortcodeUsage dataclass
Information about shortcode usage in a page.
0

Information about shortcode usage in a page.

Attributes

Name Type Description
name str
count int
lines list[int]
args dict[str, Any]
CacheInfo dataclass
Cache status for a page.
1

Cache status for a page.

Attributes

Name Type Description
status str
reason str | None
cache_key str | None
last_hit datetime | None
content_cached bool
rendered_cached bool

Methods 1

status_emoji property
Emoji for cache status.
str
def status_emoji(self) -> str

Emoji for cache status.

Returns

str

OutputInfo dataclass
Output information for a page.
1

Output information for a page.

Attributes

Name Type Description
path Path | None
url str
size_bytes int | None

Methods 1

size_human property
Human-readable output size.
str | None
def size_human(self) -> str | None

Human-readable output size.

Returns

str | None

Issue dataclass
A detected issue with a page.
1

A detected issue with a page.

Attributes

Name Type Description
severity str
issue_type str
message str
details dict[str, Any]
suggestion str | None
line int | None

Methods 1

severity_emoji property
Emoji for severity level.
str
def severity_emoji(self) -> str

Emoji for severity level.

Returns

str

PerformanceInfo dataclass
Performance timing information.
0

Performance timing information.

Attributes

Name Type Description
total_ms float
parse_ms float | None
shortcode_ms float | None
render_ms float | None
breakdown dict[str, float]
PageExplanation dataclass
Complete explanation of how a page is built. Aggregates all aspects of page building: source file …
0

Complete explanation of how a page is built.

Aggregates all aspects of page building: source file info, frontmatter, template chain, dependencies, shortcodes, cache status, and output.

Attributes

Name Type Description
source SourceInfo
frontmatter dict[str, Any]
template_chain list[TemplateInfo]
dependencies DependencyInfo
shortcodes list[ShortcodeUsage]
cache CacheInfo
output OutputInfo
performance PerformanceInfo | None
issues list[Issue] | None