Functions
static_path
0
Path
▼
Path to chirp-ui templates (chirpui.css, themes/).
Use with StaticFiles to ser…
static_path
0
Path
▼
def static_path() -> Path
Path to chirp-ui templates (chirpui.css, themes/).
Use with StaticFiles to serve CSS and themes from the package::
from chirp.middleware.static import StaticFiles
import chirp_ui
app.add_middleware(StaticFiles(
directory=str(chirp_ui.static_path()),
prefix="/static"
))
Returns
Path
get_loader
0
PackageLoader
▼
Return a PackageLoader for chirp-ui templates.
Usage (manual registration with…
get_loader
0
PackageLoader
▼
def get_loader() -> PackageLoader
Return a PackageLoader for chirp-ui templates.
Usage (manual registration without Chirp)::
from kida import ChoiceLoader, Environment, FileSystemLoader
from chirp_ui import get_loader
env = Environment(
loader=ChoiceLoader([
FileSystemLoader("templates"),
get_loader(),
])
)
Returns
PackageLoader
register_filters
1
None
▼
Register chirp-ui filters (bem, field_errors, html_attrs) on a Chirp app.
Call…
register_filters
1
None
▼
def register_filters(app: TemplateFilterApp) -> None
Register chirp-ui filters (bem, field_errors, html_attrs) on a Chirp app.
Call after App creation so chirp-ui components render correctly::
from chirp import App
import chirp_ui
app = App(...)
chirp_ui.register_filters(app)
Parameters
| Name | Type | Description |
|---|---|---|
app |
TemplateFilterApp |