mirror of
https://github.com/TheRealOwenRees/pgn_to_tex.git
synced 2026-11-18 04:42:07 +00:00
feat: add public Pgn_to_tex entry point
Move parsing and rendering internals into the private pgn_to_tex_internal library and rename pgn2tex to converter. Expose only Pgn_to_tex with default to_tex arguments, abstract diagram_data, empty_diagrams, and parse_diagrams_json. Update tests, JS bridge, and README to the new names.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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
|
||||
| Clock of string
|
||||
| Nag of string
|
||||
| Comment of string
|
||||
| Result of string
|
||||
| Variation of item list
|
||||
|
||||
type game = { tags : tag list; content : item list; result : string option }
|
||||
Reference in New Issue
Block a user