- Timestamp:
- Sep 24, 2022, 8:01:37 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cli/convert.ml
r13 r15 45 45 (match Header_pack.of_string @@ File_store.to_string fname with 46 46 | Error s -> prerr_endline s 47 | Ok { info; _ } ->47 | Ok { info; peers; _ } -> 48 48 let kv = let f = Filename.concat dir ".convert.conf" in (* TODO: better place to store convert conf? *) 49 49 if Sys.file_exists f then File_store.of_kv_file f else Store.KV.empty in … … 51 51 else Store.KV.add "Title" info.Header_pack.title kv in 52 52 let kv = Store.KV.add "Locations" (String.concat ";\n" info.Header_pack.locations) kv in 53 let kv = Store.KV.add "Peers" (String.concat ";\n" Header_pack.(to_str_list peers)) kv in 53 54 let cs = converters types kv in 54 55 directory cs noindex dir info.Header_pack.id kv) -
trunk/cli/gemini.ml
r3 r15 72 72 List.fold_left (fun a x -> a ^ list_item x x) "" (List.rev topic_roots) 73 73 74 let topic_main_index title topic_roots metas =75 74 let topic_main_index r title topic_roots metas = 75 "# " ^ title ^ "\n\n" 76 76 ^ (if topic_roots <> [] then ("## Main topics\n\n" ^ fold_topic_roots topic_roots) else "") 77 77 ^ "\n## Latest\n\n" ^ to_dated_links ~limit:10 metas 78 ^ "\n=> index.date.gmi More by date\n" 78 ^ "\n=> index.date.gmi More by date\n\n" 79 ^ let peers = Logarion.Store.KV.find "Peers" r.Conversion.kv in 80 if peers = "" then "" else 81 List.fold_left (fun a s -> Printf.sprintf "%s=> %s\n" a s) "## Peers\n\n" 82 (Str.split (Str.regexp ";\n") peers) 79 83 80 84 let topic_sub_index title topic_map topic_root metas = … … 89 93 90 94 if index_name <> "" then 91 file index_name (topic_main_index title r.topic_roots r.texts);95 file index_name (topic_main_index r title r.topic_roots r.texts); 92 96 93 97 file "index.date.gmi" (date_index title r.texts); -
trunk/cli/html.ml
r5 r15 37 37 let topic_link root topic = 38 38 let replaced_space = String.map (function ' '->'+' | x->x) in 39 "<a href='index." ^ r eplaced_space root ^ ".htm#" ^ replaced_space topic ^ "'>"39 "<a href='index." ^ root ^ ".htm#" ^ replaced_space topic ^ "'>" 40 40 ^ String.capitalize_ascii topic ^ "</a>" 41 41 … … 148 148 (fold_topic_roots topic_roots 149 149 ^ "<nav><h1>Latest</h1><ul>" ^ to_dated_links ~limit:8 metas 150 ^ {|</ul><a href="index.date.htm">More by date</a></nav>|} ) 150 ^ {|</ul><a href="index.date.htm">More by date</a>|} 151 ^ let peers = Logarion.Store.KV.find "Peers" conv.kv in 152 (if peers = "" then "" else 153 List.fold_left (fun a s -> Printf.sprintf {|%s<li><a href="%s">%s</a>|} a s s) "<h1>Peers</h1><ul>" 154 (Str.split (Str.regexp ";\n") (Logarion.Store.KV.find "Peers" conv.kv)) 155 ^ "</ul>")) 151 156 152 157 let topic_sub_index conv htm topic_map topic_root metas = … … 172 177 173 178 let base_url = try 174 let _i = Str.(search_forward (regexp "https?://[^;]*") (Store.KV.find "Locations" c.kv) 0) in 175 Str.(matched_string (Store.KV.find "Locations" c.kv)) 179 let locs = Store.KV.find "Locations" c.kv in 180 let _i = Str.(search_forward (regexp "https?://[^;]*") locs 0) in 181 Str.(matched_string locs) 176 182 with Not_found -> prerr_endline "Missing location for HTTP(S)"; "" in 177 183 file "feed.atom" (Atom.feed title c.id base_url "text/html" c.texts) -
trunk/install
r14 r15 3 3 Requirements are ocaml (the compiler) and opam (the package manager). Then run: 4 4 5 opam pin add text_parse git://orbitalfox.eu/text-parse-ml6 opam pin add logarion git://orbitalfox.eu/logarion5 opam pin add text_parse https://git.disroot.org/orbifx/text-parse-ml.git 6 opam pin add logarion https://git.disroot.org/orbifx/logarion.git 7 7 opam install logarion -
trunk/readme
r14 r15 6 6 7 7 Source: <http://git.disroot.org/orbifx/logarion> 8 EUPL licence:<http://joinup.ec.europa.eu/software/page/eupl>8 Licence: EUPL <http://joinup.ec.europa.eu/software/page/eupl> 9 9 10 10 IRC: <irc://tilde.chat/#logarion>
Note:
See TracChangeset
for help on using the changeset viewer.