Changeset 15 in code for trunk/cli/html.ml
- Timestamp:
- Sep 24, 2022, 8:01:37 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note:
See TracChangeset
for help on using the changeset viewer.