Commit Graph
2 Commits
Author SHA1 Message Date
Nguyen Hoang DuongandPanos Vagenas 1707a2dda4 feat(doclang): add partial DocLang 0.8 support with multiple captions (#880)
* chore(doclang): align w doclang 0.8

Signed-off-by: Daniel Nguyen <danielnguyenh07@gmail.com>

* feat(doclang): support multiple captions and skip track for DocLang 0.8

DocLang 0.8 allows several captions in an element head. The serializer
now writes all captions of a floating item there, instead of the first
one in the head and the others as <text> next to it in a <group>. The
deserializer reads all head captions, and still reads <text> siblings
as captions, so that earlier output keeps loading.

<track> is not supported yet: the deserializer skips it with a warning,
instead of dropping its cues and leaking its chapter texts. The module
docstrings state the support as partial.

doclang 0.8 selects the schema by the declared version and warns when
there is none. The test helpers validate documents without a version
against _DOCLANG_VERSION. The data lint gets a dclx.version check that
warns on a missing version, and fails validation on a declared version
without schema rather than falling back to the latest one.

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

---------

Signed-off-by: Daniel Nguyen <danielnguyenh07@gmail.com>
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
Co-authored-by: Panos Vagenas <pva@zurich.ibm.com>
2026-10-21 10:07:13 +02:00
Panos Vagenas 2887ddfa13 chore(scripts): add private data lint for DoclingDocument JSON and DocLang (#858)
* chore(scripts): add a private data lint for DoclingDocument JSON and DocLang files

scripts/_data_lint.py checks a .json, a .dclx/.dclg/.xml, or a pair (--pair): load and model rules, schema validity, deserializability, the DocLang round trip, and JSON <-> DocLang conversion, with --only/--skip, --list-checks and --report. Includes a readme and tests.

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* chore(scripts): fail the data lint when a check cannot run

A missing Schematron backend made dclx.schematron pass as 'skipped', so a run could end OK with a check missing. It now fails with a hint (install doclang[schematron-saxon], or --skip dclx.schematron), and the skip status is removed.

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

---------

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2026-10-09 20:52:20 +02:00