OCaml library for JSONfeed parsing and creation
1type t = {
2 url : string;
3 doi : string option;
4 cito : Cito.t list option;
5}
6
7let create ~url ?doi ?cito () = { url; doi; cito }
8
9let url t = t.url
10let doi t = t.doi
11let cito t = t.cito
12
13let equal a b = String.equal a.url b.url
14
15let pp ppf t =
16 let open Format in
17 fprintf ppf "%s" t.url;
18 match t.doi with
19 | Some d -> fprintf ppf " [DOI: %s]" d
20 | None -> ()