<lea:script> is Lea's extensibility mechanism for edge cases and generated content.
Scripts are executed in multiple compiler phases (not a single-pass macro):
- after loading ebook XML and reading subfolder/options
- after XHTML validation is complete
- after block resolution (because blocks may introduce additional scripts)
Effect semantics:
- script node is consumed
- script output is inserted in place
- newly introduced script nodes can be resolved in later passes
- selector:
textContentof<lea:script> - selector matching: case-insensitive lookup in
AlphabetSt::$lut - attributes: free-form; each script decides what it reads and whether it is required
Unknown selector behavior:
- depends on compiler implementation; should be treated as invalid usage unless explicitly tolerated.
Source: src/Adore/AlphabetSt.php
Aliases:
toctable of contentslist content
Reads attributes:
- none
Behavior:
- inserts
<ol><li><lea:link>...</lea:link></li>...</ol>from ebook text list.
Aliases:
toc plainlist content plaintable of contents plain
Reads attributes:
skip(optional regex body; wrapped as/<skip>/i)
Behavior:
- inserts sorted plain-text title list, optionally filtered by
skip.
Aliases:
colophonlist rightstext rightslist text rights
Reads attributes:
- none
Behavior:
- concatenates rights content from all texts.
Aliases:
blurbslist blurbstext blurbs
Reads attributes:
class(optional; default"")heading(optional; defaulth4)
Behavior:
- builds heading + blurb blocks for texts with blurbs.
Aliases:
list authorsauthorstext authors
Reads attributes:
folder(optional; prefix for block paths)class(optional; applied to separator div)skip(optional regex body; wrapped as/<skip>/i)
Behavior:
- deduplicates/sorts authors (uses
fileAswhen present), emits<lea:block>entries.
Aliases:
linked image
Reads attributes:
to(required)image(required)caption(optional; fallbackdefaultcaptionmemory key)folder(optional; fallbacksubfolder-imagesmemory key)
Behavior:
- emits
<figure><lea:link to='...'><img .../></lea:link><figcaption>...</figcaption></figure> - registers image in ebook image set.
Failure behavior:
- missing
to->linkedImageMissingTo - missing
image->linkedImageMissingImage
lea:scriptattribute requirements are script-specific and should live here, not in core grammar.- Keep this file synced with
AlphabetStwhenever new handlers are added or signatures/attribute requirements change.