OCaml library for JSONfeed parsing and creation

remove eio dep

+12 -12
+1 -1
.tangled/workflows/build.yml
··· 33 33 opam init --disable-sandboxing -any 34 34 - name: switch 35 35 command: | 36 - opam install . --confirm-level=unsafe-yes --deps-only 36 + opam install . --confirm-level=unsafe-yes --deps-only -t 37 37 - name: build 38 38 command: | 39 39 opam exec -- dune build --verbose
+3 -3
example/dune
··· 1 1 (executable 2 2 (name feed_example) 3 3 (modules feed_example) 4 - (libraries jsonfeed eio_main)) 4 + (libraries jsonfeed)) 5 5 6 6 (executable 7 7 (name feed_parser) 8 8 (modules feed_parser) 9 - (libraries jsonfeed eio_main)) 9 + (libraries jsonfeed)) 10 10 11 11 (executable 12 12 (name feed_validator) 13 13 (modules feed_validator) 14 - (libraries jsonfeed eio_main)) 14 + (libraries jsonfeed))
+8 -8
example/feed_example.ml
··· 8 8 9 9 open Jsonfeed 10 10 11 - (* Helper to write feed to Eio flow *) 12 - let to_flow flow feed = 11 + (* Helper to write feed to output channel *) 12 + let to_file filename feed = 13 13 let s = Jsonfeed.to_string feed in 14 - Eio.Flow.copy_string s flow 14 + Out_channel.with_open_gen 15 + [Open_wronly; Open_creat; Open_trunc; Open_text] 16 + 0o644 17 + filename 18 + (fun oc -> Out_channel.output_string oc s) 15 19 16 20 let create_blog_feed () = 17 21 (* Create some authors *) ··· 125 129 feed 126 130 127 131 let main () = 128 - Eio_main.run @@ fun env -> 129 - 130 132 (* Create blog feed *) 131 133 let blog_feed = create_blog_feed () in 132 134 Format.printf "Created blog feed: %a\n\n" Jsonfeed.pp blog_feed; ··· 137 139 (String.sub json_string 0 (min 200 (String.length json_string))); 138 140 139 141 (* Serialize to file *) 140 - let feed_path = Eio.Path.(env#fs / "blog-feed.json") in 141 - Eio.Path.with_open_out ~create:(`Or_truncate 0o644) feed_path @@ fun flow -> 142 - to_flow (flow :> Eio.Flow.sink_ty Eio.Resource.t) blog_feed; 142 + to_file "blog-feed.json" blog_feed; 143 143 Format.printf "Wrote blog feed to blog-feed.json\n\n"; 144 144 145 145 (* Create podcast feed *)