Events: 3861 → 21 lines, split into 8 sub-modules (renders, helpers, layouts, calendar, entries, slots, tickets, utils). Updated 16 bp routes. SX Docs: 3224 → 27 lines, split into 5 sub-modules (renders, utils, essays, helpers, layouts). Updated 37 import sites in bp/pages/routes.py. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
965 B
Python
28 lines
965 B
Python
"""SX docs defpage setup — registers layouts and page helpers."""
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from shared.sx.jinja_bridge import load_sx_dir, watch_sx_dir
|
|
|
|
|
|
def setup_sx_pages() -> None:
|
|
"""Register sx-specific layouts, page helpers, and load page definitions."""
|
|
from .layouts import _register_sx_layouts
|
|
from .helpers import _register_sx_helpers
|
|
_register_sx_layouts()
|
|
_register_sx_helpers()
|
|
_load_sx_page_files()
|
|
|
|
|
|
def _load_sx_page_files() -> None:
|
|
"""Load defpage definitions from sx/sxc/pages/*.sx."""
|
|
from shared.sx.pages import load_page_dir
|
|
from shared.sx.jinja_bridge import load_service_components
|
|
_sxc_dir = os.path.dirname(os.path.dirname(__file__)) # sx/sxc/
|
|
service_root = os.path.dirname(_sxc_dir) # sx/
|
|
load_service_components(service_root, service_name="sx")
|
|
load_sx_dir(_sxc_dir)
|
|
watch_sx_dir(_sxc_dir)
|
|
load_page_dir(os.path.dirname(__file__), "sx")
|