This document defines the user-facing grammar for Lea source files.
Scope:
- Ebook config XML (
arx/ebooks/.../*.xml) - Text/block XHTML files (
arx/text/...,arx/blocks/...)
Conventions:
- count is cardinality in the relevant document scope.
- string means value resolved from
textContent(inline markup stripped unless otherwise noted). - innerHTML means inline markup is preserved as markup payload.
- count:
1 - format:
string(resolved viatextContent)
- count:
> 0 - format:
string(resolved viatextContent) - attributes:
file-as— count[0,1], formatstring
- count:
1 - format: anything
DateTimeunderstands - attributes:
created— count[0,1], format anythingDateTimeunderstands
- count:
>= 0 - format:
string(resolved viatextContent)
- count:
[0,1] - format:
string(resolved viatextContent) - attributes:
type— count1, allowed value:seriesposition— count1, formatintegerissn— count1, formatstring
- count:
1 - format:
string(resolved viatextContent) - attributes:
contact— count1, formatstring
- count:
1 - format:
innerHTML
- count:
1 - format:
string(resolved viatextContent)
- count:
>= 0 - format:
string(resolved viatextContent) - attributes:
tag— count1, allowed values:epub,text,images
- count:
>= 0 - format:
string(resolved viatextContent) - attributes:
value— count1, formatstring
- count:
> 0 - format:
string(resolved viatextContent)
- count:
>= 0 - format:
string(resolved viatextContent)
- count:
1 - format: valid ISBN (
/^\d{13}$/and checksum verified)
- count:
>= 0 - format:
string(resolved viatextContent) - attributes:
roles— count1, formatstring
- count:
>= 0 - format:
string(resolved viatextContent)
- count:
>= 0 - format:
string(resolved viatextContent)
- count:
1 - format:
string(resolved viatextContent)
- count:
>= 0 - format:
string(resolved viatextContent) - attributes:
source— count1, formatstringfolder— count[0,1], formatstring
- children:
<lea:caption>— count[0,1], formatinnerHTML
- count:
[0,1] - format:
innerHTML
- count:
>= 0 - format:
string(resolved viatextContent)
- count:
>= 0 - format:
string(resolved viatextContent)
- count:
>= 0(optional convenience tag, both per-file and globally) - format:
string(resolved viatextContent) - attributes:
title— count[0,1], formatstringclass— count[0,1], formatstring
- count:
>= 0(optional convenience tag, both per-file and globally) - format:
string(resolved viatextContent) - attributes:
title— count[0,1], formatstringcontent-top— count[0,1], formatstringclass-top— count[0,1], formatstringclass-bottom— count[0,1], formatstring
- count:
>= 0 - format:
string(resolved viatextContent) - attributes:
folder— count[0,1], formatstring
- count:
>= 0 - format:
string(script selector viatextContent) - attributes: free-form key/value map (
string→string)
lea:script is an extensibility hook.
DOMElement->textContentidentifies the runtime script handler.- Attributes are consumed by that handler.
- Formal per-script attribute requirements are defined in
SCRIPTS.md/AlphabetSt, not in core grammar.