mirror of
https://github.com/TheRealOwenRees/pgn_to_tex.git
synced 2026-11-18 12:52:06 +00:00
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:
+6
-4
@@ -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 -> ()
|
||||
|
||||
Reference in New Issue
Block a user