Functions
_walk_block_parents
4
None
▼
Map each block/region name to its nearest enclosing block/region name.
Fragmen…
_walk_block_parents
4
None
▼
def _walk_block_parents(nodes: Sequence[Node], enclosing: str | None, parent_map: dict[str, str | None], fragment_names: set[str]) -> None
Map each block/region name to its nearest enclosing block/region name.
Fragment block names are collected infragment_namesso the caller can
skip them —{% fragment %}blocks are swap-only and never participate
in full-page composition, so they are reachable by definition via
render_block / render_fragment.
Parameters
| Name | Type | Description |
|---|---|---|
nodes |
Sequence[Node] |
|
enclosing |
str | None |
|
parent_map |
dict[str, str | None] |
|
fragment_names |
set[str] |
_block_is_reachable
3
bool
▼
True if block_name is a composition root or nested under one.
_block_is_reachable
3
bool
▼
def _block_is_reachable(block_name: str, roots: set[str], parent_map: dict[str, str | None]) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
block_name |
str |
|
roots |
set[str] |
|
parent_map |
dict[str, str | None] |
Returns
bool
check_unreachable_blocks
3
list[ContractIssue]
▼
Detect blocks in page templates that ``render_with_blocks`` cannot reach.
When…
check_unreachable_blocks
3
list[ContractIssue]
▼
def check_unreachable_blocks(page_leaf_templates: set[str], kida_env: Environment | None, *, extras: dict[str, Any] | None = None) -> list[ContractIssue]
Detect blocks in page templates thatrender_with_blockscannot reach.
When Chirp composes filesystem pages into layouts, only thecontent
slot (fed from the rendered page block subtree) participates. Blocks that
are siblings of the composition roots — for examplepage_scriptsnext
topage_root— are never rendered and are silently dropped.
Parameters
| Name | Type | Description |
|---|---|---|
page_leaf_templates |
set[str] |
|
kida_env |
Environment | None |
|
extras |
dict[str, Any] | None |
Default:None
|
Returns
list[ContractIssue]