Rules the validator checks
Beyond the schemas:
- Every section file named in
book.jsonexists, and the cover exists. - Every asset path (
audio,src,image) points to a file in the package. Fullhttps://URLs are allowed but not recommended: books must work offline. - Every localized map contains the base locale.
- Block ids are unique in each section file.
- Exercise answers match their prompts (Exercises).
- Passage words appear in their sentence in order and name a sense in
lexicon.json; sense ids are unique and their audio exists. - Example
partsuse a known role and appear in the line in order. - Japanese books follow the furigana rules.
Run it from the starter kit:
pip install jsonschema
python3 validate_books.py path/to/my-book
Versions and compatibility
schemachanges only for breaking changes. A reader that knows schema 2 cannot open schema 3.formatVersion(feature level) rises by one whenever a block kind, text mark or exercise type is added. Ledu works out the lowest level each book needs when it is published, so a book that uses nothing new stays readable on older app versions. Level 1 is everything not listed below; level 2 addspassage; level 3 adds furigana; level 4 adds public paid-book samples; level 5 adds Chineseverseblocks; level 6 adds literature style presets; level 7 adds opening vertical title/chapter columns with independent font sizes; level 8 adds edition-localized modern notes following each verse; level 9 adds a native notes seal; level 10 addsverse.sourceFormsso subtitles follow the transcription toggle.- A block kind the reader does not know is shown as a short “needs a newer version” note; the rest of the section still reads.
- Unknown fields are ignored, so a
"$schema"key pointing at the schema URL is allowed (and lets editors such as VS Code check the file as you type).