logarion/lib/category.ml
orbifx 22fe21326f Samhain 21
Converter
- type selection
- subdir conversion
- htm extension

Gemini
- index.gmi
- topics and latest
- gmi.atom feed

Add pull (http(s)) operation
- peers.pub.conf and peers.priv.conf

HTML5 format & fixes by Novaburst
Phony target (thanks Gergely)

May

Basic unit renamed from Note to Text.
New modular text-parser, internal to Logarion, for generic notation parsing. The default input format is now a much plainer text.
Logarion created texts have part of the UUID in filename.
Logarion's index re-written in Messagepack format. Removed `indices` command. They are generated during `convert`.
2021-11-03 22:29:57 +00:00

22 lines
764 B
OCaml

module Category = struct
type t = Unlisted | Published | Invalid | Custom of string
let compare = Stdlib.compare
let of_string = function "unlisted" | "published" -> Invalid | c -> Custom c
let to_string = function Custom c -> c | _ -> ""
end
include Category
module CategorySet = struct
include Set.Make (Category)
let of_stringset s = String_set.fold (fun e a -> add (Category.of_string e) a) s empty
let of_query q = of_stringset (fst q), of_stringset (snd q)
let predicate (inc, exl) set = not (disjoint inc set) && disjoint exl set
let of_string x = of_stringset (String_set.of_string x)
let to_string set =
let f elt a =
let s = Category.to_string elt in
if a <> "" then a ^ ", " ^ s else s
in
fold f set ""
end