JSON Feed 1.1 parser and serializer
0

Configure Feed

Select the types of activity you want to include in your feed.

OCaml 96.2%
Dune 1.3%
Other 2.5%
2 1 0

Clone this repository

https://git.vm.fail/gazagnaire.org/ocaml-jsonfeed https://git.vm.fail/did:plc:4d3rwgaed5as4xatc76p5vku
ssh://git@git.recoil.org:2222/gazagnaire.org/ocaml-jsonfeed ssh://git@git.recoil.org:2222/did:plc:4d3rwgaed5as4xatc76p5vku

For self-hosted knots, clone URLs may differ based on your setup.


README.md

nox-jsonfeed#

Warning. This is a work-in-progress experimental fork of ocaml-jsonfeed. Do not use it in production; use ocaml-jsonfeed instead.

Type-safe parsing and serialization of the JSON Feed 1.1 syndication format -- a JSON alternative to RSS and Atom. Each feed object (feed, item, author, attachment, hub) is a typed OCaml record with a declarative nox-json codec that preserves unknown extension members across a decode/encode round-trip.

Overview#

nox-jsonfeed is a fork of @anil.recoil.org/ocaml-jsonfeed with the jsont codec replaced by nox-json, and its I/O surface aligned to the monorepo encoding conventions (of_string / of_reader / to_string / to_writer, each with an _exn twin).

Usage#

$ opam install nox-jsonfeed
let roundtrip s =
  match Jsonfeed.of_string s with
  | Error e -> Error (Jsonfeed.Json.Error.to_string e)
  | Ok feed -> Ok (Jsonfeed.to_string feed)

API#

  • Jsonfeed.of_string / of_string_exn / of_reader / of_reader_exn - decode a feed.
  • Jsonfeed.to_string / to_writer (both ?indent ?preserve) - encode a feed.
  • Jsonfeed.Item, Author, Attachment, Hub, Reference - the typed feed objects, each with create, accessors, and a codec.
  • ocaml-jsonfeed - the upstream this forks, by Anil Madhavapeddy, over jsont.
  • nox-json / jsont - the JSON codec library this builds on.

License#

ISC (upstream's license). See LICENSE.md.