- 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
2022-04-01 17:35:56 +02:00
|
|
|
let random_state = Random.State.make_self_init
|
|
|
|
|
|
|
|
(*module UUID = struct*)
|
|
|
|
(*type t = Uuidm.t*)
|
|
|
|
(*let compare = Uuidm.compare*)
|
|
|
|
(*let to_string = Uuidm.to_string*)
|
|
|
|
(*let of_string = Uuidm.of_string*)
|
|
|
|
(*let to_bytes = Uuidm.to_bytes*)
|
|
|
|
(*let of_bytes = Uuidm.of_bytes*)
|
|
|
|
(*let generate ?(random_state=random_state ()) = Uuidm.v4_gen random_state*)
|
|
|
|
(*let nil = Uuidm.nil*)
|
|
|
|
(*end*)
|
|
|
|
|
|
|
|
type t = string
|
|
|
|
let compare = String.compare
|
|
|
|
let nil = ""
|
|
|
|
|
|
|
|
let short ?(len) id =
|
|
|
|
let id_len = String.length id in
|
|
|
|
let l = match len with Some l -> l | None -> if id_len = 36 then 8 else 6 in
|
|
|
|
String.sub id 0 (min l id_len)
|
|
|
|
|
|
|
|
let generate ?(len=6) ?(seed=random_state ()) () =
|
|
|
|
let b32 i = char_of_int @@
|
|
|
|
if i < 10 then i+48 else
|
|
|
|
if i < 18 then i+87 else
|
|
|
|
if i < 20 then i+88 else
|
|
|
|
if i < 22 then i+89 else
|
|
|
|
if i < 27 then i+90 else
|
|
|
|
if i < 32 then i+91 else
|
|
|
|
(invalid_arg ("id.char" ^ string_of_int i)) in
|
|
|
|
let c _ = b32 (Random.State.int seed 31) in
|
|
|
|
String.init len c
|