source: code/trunk/lib/archive.ml@ 2

Last change on this file since 2 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: 1.3 KB
Line 
1(*let module S = Set.Make (Text) in*)
2(*let module M = Map.Make (String) in*)
3(*let module I = Map.Make (Id) in*)
4(*let aggr = I.empty, M.empty, M.empty, M.empty in*)
5(*let fn (id, a, t, k) (n,_) =*)
6(* let id = I.add n.Text.uuid n id in*)
7(* let a =*)
8(* let f e a = M.update (e.Person.name) (function Some v -> Some (S.add n v) | None -> Some (S.singleton n)) a in*)
9(* Person.Set.fold f n.Text.authors a in*)
10(* let t =*)
11(* let f e a = M.update e (function Some v -> Some (S.add n v) | None -> Some (S.singleton n)) a in*)
12(* String_set.fold f (Text.set "Topics" n) t in*)
13(* let k =*)
14(* let f e a = M.update e (function Some v -> Some (S.add n v) | None -> Some (S.singleton n)) a in*)
15(* String_set.fold f (Text.set "Keywords" n) k in*)
16(* (id, a, t, k)*)
17
18module Make (Store : Store.T) = struct
19 include Store
20 let predicate fn opt = Option.(to_list @@ map fn opt)
21
22 let authored query_string =
23 let q = Person.Set.of_query @@ String_set.query query_string in
24 fun n -> Person.Set.predicate q n.Text.authors
25
26 let keyworded query_string =
27 let q = String_set.query query_string in
28 fun n -> String_set.(predicate q (Text.set "Keywords" n))
29
30 let topics query_string =
31 let q = String_set.query query_string in
32 fun n -> String_set.(predicate q (Text.set "Topics" n))
33end
Note: See TracBrowser for help on using the repository browser.