Move 24 defcomp definitions from Python string constants in components.py to 7 grouped .sexp files under shared/sexp/templates/. Add load_sexp_dir() to jinja_bridge.py for file-based loading. Migrate events and market link-card fragment handlers from render_template to sexp. Delete 9 superseded Jinja HTML fragment templates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 lines
476 B
Python
19 lines
476 B
Python
"""
|
|
Shared s-expression component definitions.
|
|
|
|
Loaded at app startup via ``load_shared_components()``. Each component
|
|
is defined in an external ``.sexp`` file under ``templates/``.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from .jinja_bridge import load_sexp_dir
|
|
|
|
|
|
def load_shared_components() -> None:
|
|
"""Register all shared s-expression components."""
|
|
templates_dir = os.path.join(os.path.dirname(__file__), "templates")
|
|
load_sexp_dir(templates_dir)
|