Feature/variations (#5)

* support diagrams in variations.

* Diagram data now carries an optional `path` (the SAN move sequence from the root) alongside the legacy `ply`; diagrams whose `path` resolves inside a variation are rendered inline within the variation. `parse_diagrams_json` returns a `diagram_data` record with `by_ply` and `by_path` maps.

* make variation boards slightly smaller than the mainline boards

* update changelog v0.0.2
This commit is contained in:
2026-10-18 20:06:43 +02:00
committed by GitHub
parent 5831ddfb5e
commit fe9eb8ba45
12 changed files with 207 additions and 79 deletions
+6 -4
View File
@@ -126,7 +126,7 @@ let test_author =
]
let test_diagram _ctxt =
match Latex_helpers.get_diagram 5 Helpers.Latex_helper.diagram_data with
match Latex_helpers.get_diagram ~ply:5 Helpers.Latex_helper.diagram_data with
| Some actual ->
let expected =
"\n\\par\\nobreak\\medskip\\chessboard[setfen="
@@ -138,8 +138,8 @@ let test_diagram _ctxt =
let test_diagram_clock _ctxt =
match
Latex_helpers.get_diagram 5 Helpers.Latex_helper.diagram_data ~clock:true
~white_time:"1:00" ~black_time:"0:21"
Latex_helpers.get_diagram ~ply:5 Helpers.Latex_helper.diagram_data
~clock:true ~white_time:"1:00" ~black_time:"0:21"
with
| Some actual ->
let expected =
@@ -151,7 +151,9 @@ let test_diagram_clock _ctxt =
| None -> assert_failure "Diagram for ply 5 was not found"
let test_no_diagram _ctxt =
let result = Latex_helpers.get_diagram 99 Helpers.Latex_helper.diagram_data in
let result =
Latex_helpers.get_diagram ~ply:99 Helpers.Latex_helper.diagram_data
in
match result with
| None -> ()