Changeset 3 in code for trunk/lib/archive.ml


Ignore:
Timestamp:
Apr 15, 2022, 1:17:01 PM (3 years ago)
Author:
fox
Message:
  • Removed 'txt init'

Format

  • New B32 ID

Index

  • New option: txt index --print
  • Move scheme to peers
  • Replace peer.*.conf files with index packed locations Instead of adding a URL to peers.*.conf, run txt pull <url>

Conversion

  • Rewritten converters
  • txt-convert looks for a .convert.conf containing key: value lines.
  • Specifiable topic-roots from .convert.conf.
  • Added Topics: key, with comma seperated topics.

If set only those topics will appear in the main index and used as topic roots.
Other topics will have sub-indices generated, but won't be listed in the main index.

  • HTML converter header & footer options
  • HTML-index renamed to HTM-index

Internal

  • Change types: uuid:Uuid -> id:string
  • File_store merges identical texts
  • Use peer ID for store path, store peers' texts in .local/share/texts
  • Simple URN resolution for converter

Continue to next feed if parsing one fails

  • Phasing-out Archive, replaced by improved packs
  • Eliminate Bos, Cohttp, lwt, uri, tls, Re, Ptime, dependencies
  • Lock version for Cmdliner, fix dune-project
  • Optional resursive store
  • Improve header_pack
  • Fix recursive mkdir
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/archive.ml

    r2 r3  
    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)*)
     1let predicate fn opt = Option.(to_list @@ map fn opt)
    172
    18 module Make (Store : Store.T) = struct
    19   include Store
    20   let predicate fn opt = Option.(to_list @@ map fn opt)
     3let authored query_string =
     4  let q = Person.Set.of_query @@ String_set.query query_string in
     5  fun n -> Person.Set.predicate q n.Text.authors
    216
    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
     7let keyworded query_string =
     8  let q = String_set.query query_string in
     9  fun n -> String_set.(predicate q (Text.set "Keywords" n))
    2510
    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))
    33 end
     11let topics query_string =
     12  let q = String_set.query query_string in
     13  fun n -> String_set.(predicate q (Text.set "Topics" n))
Note: See TracChangeset for help on using the changeset viewer.