mirror of
https://github.com/TheRealOwenRees/pgn_to_tex.git
synced 2026-11-18 04:42:07 +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:
@@ -1,7 +1,16 @@
|
||||
module MoveMap = Map.Make (Int)
|
||||
module PathMap = Map.Make (String)
|
||||
|
||||
type tag = { key : string; value : string }
|
||||
|
||||
(* Diagrams selected by the client. [by_ply] keeps the legacy mainline lookup
|
||||
keyed on the ply number; [by_path] keys on the SAN move sequence from the
|
||||
root (space separated), which uniquely identifies mainline and variation
|
||||
positions alike. *)
|
||||
type diagram_data = { by_ply : string MoveMap.t; by_path : string PathMap.t }
|
||||
|
||||
let empty_diagrams = { by_ply = MoveMap.empty; by_path = PathMap.empty }
|
||||
|
||||
type item =
|
||||
| Move of string
|
||||
| Number of string
|
||||
|
||||
Reference in New Issue
Block a user