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`. git-svn-id: file:///srv/svn/repo/kosuzu/trunk@2 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
22
lib/category.ml
Normal file
22
lib/category.ml
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
Reference in New Issue
Block a user