Functions
plugin_snippet
1
str
▼
Build Alpine plugin script tags pinned to the core version.
plugin_snippet
1
str
▼
def plugin_snippet(version: str) -> str
Parameters
| Name | Type | Description |
|---|---|---|
version |
str |
Returns
str
alpine_json_config
2
Markup
▼
Emit a ```` tag for Alpine component config.
Provides a safe bridge for passin…
alpine_json_config
2
Markup
▼
def alpine_json_config(dom_id: str, data: Any) -> Markup
Emit a<script type="application/json">tag for Alpine component config.
Provides a safe bridge for passing server-side data to client-side Alpine
components without HTML attribute quoting issues. Registered as a template
global whenAppConfig(alpine=True).
Parameters
| Name | Type | Description |
|---|---|---|
dom_id |
str |
|
data |
Any |
Python value to serialize as JSON. Uses :func: |
Returns
Markup
alpine_snippet
2
str
▼
Build the full Alpine.js injection block.
Includes plugins (Mask, Intersect, F…
alpine_snippet
2
str
▼
def alpine_snippet(version: str, csp: bool = False) -> str
Build the full Alpine.js injection block.
Includes plugins (Mask, Intersect, Focus) pinned to the same version as the
Alpine core script, thesafeDatahelper with chirp-ui store init, and
the Alpine.js core script.
The script URL must include/dist/cdn.min.js. A bare alpinejs@version
path on jsdelivr resolves topackage.json main (dist/module.cjs.js),
which is CommonJS and throwsReferenceError: module is not definedin the
browser when loaded as a classic script.
Parameters
| Name | Type | Description |
|---|---|---|
version |
str |
Alpine version (e.g. "3.15.8"). |
csp |
bool |
If True, use the False
|
Returns
str