Filesystem-based routing with automatic layout nesting.
Combines co-located routes and templates, automatic layout composition,
and htmx-header-driven rendering depth. Thepages/directory
structure defines URL paths, layout nesting, and context inheritance.
Usage::
app = App(AppConfig(template_dir="pages"))
app.mount_pages("pages")
app.run()
Conventions:
pages/
_layout.html # Root layout (target: body)
_context.py # Root context provider
documents/
page.py # GET /documents
{doc_id}/
_layout.html # Nested layout (target: app-content)
_context.py # Context: loads doc
page.py # GET /documents/{doc_id}
edit.py # POST /documents/{doc_id}/edit
pages
| 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
|
|
— |
View source · /home/runner/work/chirp/chirp/site/../src/chirp/pages/__init__.py:1