source: code/trunk/lib/category.ml@ 36

Last change on this file since 36 was 2, checked in by fox, 3 years ago

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.

File size: 764 bytes
Line 
1module Category = struct
2 type t = Unlisted | Published | Invalid | Custom of string
3 let compare = Stdlib.compare
4 let of_string = function "unlisted" | "published" -> Invalid | c -> Custom c
5 let to_string = function Custom c -> c | _ -> ""
6end
7
8include Category
9
10module CategorySet = struct
11 include Set.Make (Category)
12 let of_stringset s = String_set.fold (fun e a -> add (Category.of_string e) a) s empty
13 let of_query q = of_stringset (fst q), of_stringset (snd q)
14 let predicate (inc, exl) set = not (disjoint inc set) && disjoint exl set
15 let of_string x = of_stringset (String_set.of_string x)
16 let to_string set =
17 let f elt a =
18 let s = Category.to_string elt in
19 if a <> "" then a ^ ", " ^ s else s
20 in
21 fold f set ""
22end
Note: See TracBrowser for help on using the repository browser.