My agentic slop goes here. Not intended for anyone else!
at main 1.9 kB view raw
1(* 2 * Copyright (c) 2014, OCaml.org project 3 * Copyright (c) 2015 KC Sivaramakrishnan <sk826@cl.cam.ac.uk> 4 * 5 * Permission to use, copy, modify, and distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 *) 17 18(** Custom categories for organizing posts. 19 20 Categories are manually defined and can be assigned to posts for 21 organization and filtering. This is separate from feed-extracted tags. *) 22 23type t 24(** A custom category with metadata. *) 25 26val create : 27 id:string -> 28 name:string -> 29 ?description:string -> 30 unit -> 31 t 32(** [create ~id ~name ?description ()] creates a new category. 33 34 @param id Unique identifier for the category (e.g., "ocaml-projects") 35 @param name Display name (e.g., "OCaml Projects") 36 @param description Optional longer description *) 37 38val id : t -> string 39(** [id category] returns the unique identifier of the category. *) 40 41val name : t -> string 42(** [name category] returns the display name of the category. *) 43 44val description : t -> string option 45(** [description category] returns the description, if any. *) 46 47val to_json : t -> Jsont.json 48(** [to_json category] serializes a category to JSON. *) 49 50val of_json : Jsont.json -> (t, string) result 51(** [of_json json] deserializes a category from JSON. *) 52 53val jsont : t Jsont.t 54(** Jsont codec for categories. *)