templating.fragment_target_registry

Page actions AI-ready formats and sharing
Open LLM text
Share with AI
Ask Claude Ask ChatGPT Ask Gemini Ask Copilot

App-level fragment target registry for HTMX content-region block selection.

Maps target IDs (e.g.page-root) to fragment_block config. When HX-Target matches a registered target, Chirp uses the registry's fragment_block instead of composition.page_block.…

App-level fragment target registry for HTMX content-region block selection.

Maps target IDs (e.g.page-root) to fragment_block config. When HX-Target matches a registered target, Chirp uses the registry's fragment_block instead of composition.page_block. Apps can group related targets into a page shell contract so app-level layout expectations are explicit and contract-checkable. The registry is mutable during setup and frozen at runtime.

templating.fragment_target_registry

Name Type Default Description
type
qualified_name
element_type
description
source_file
line_number
is_autodoc
autodoc_element
_autodoc_template
_autodoc_url_path
_autodoc_page_type
title
doc_content_hash

Symbols on this page

PageShellTarget
class

A single target participating in a page shell contract.

PageShellContract
class

Named group of fragment targets defining an app shell contract.

FragmentTargetConfig
class

Block config for a single fragment target.

Layers (see UI layers guide): targets that swap page content inside #page-content may still set triggers_shell_updateso shell regions (topbarshell_actions, title, etc.) refresh via OOB after the primary swap.

fragment_block: Block to render when HX-Target matches (e.g. page_root_inner). triggers_shell_update: When True, this swap participates in shell negotiation (e.g.shell_actionsOOB). Use False for narrow in-page swaps (e.g.#page-content-inner) that must not refresh the app shell. omit_outer_layouts: When True, boosted responses for this HX-Target skip composing filesystem layouts (page HTML only). Use for marketing shells where the outlet wraps the whole{% block content %}and re-applying the root layout would duplicate header/footer inside the outlet.

FragmentTargetRegistry
class

App-level registry mapping target IDs to fragment block config.

Mutable during setup, frozen at runtime (same lifecycle as routes).

View source · /home/runner/work/chirp/chirp/site/../src/chirp/templating/fragment_target_registry.py:1