Changeset 41 in code for trunk/cli/html.ml
- Timestamp:
- Dec 13, 2022, 11:04:19 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cli/html.ml
r39 r41 40 40 header body footer 41 41 42 let topic_link root topic = 42 let topic_link root topic = 43 43 let replaced_space = String.map (function ' '->'+' | x->x) in 44 44 "<a href='index." ^ root ^ ".htm#" ^ replaced_space topic ^ "'>" … … 47 47 module HtmlConverter = struct 48 48 include Converter.Html 49 let uid_uri u a = Printf.sprintf "%s<a href='%s%s'> %s</a>" a u ext u49 let uid_uri u a = Printf.sprintf "%s<a href='%s%s'><%s></a>" a u ext u 50 50 let angled_uri u a = 51 51 if try String.sub u 0 10 = "urn:txtid:" with Invalid_argument _ -> false … … 74 74 String_set.fold (fun r a -> sep_append a (link r)) x "" 75 75 in 76 Printf.eprintf "%s %d\n" text.id (Conversion.Id_map.cardinal conversion.Conversion.replies); 76 77 "<article><header><dl>" 77 78 ^ opt_kv "Title:" text.title … … 82 83 ^ opt_kv "Id:" text.id 83 84 ^ opt_kv "Refers:" (ref_links (set "references" text)) 85 ^ opt_kv "In reply to:" (ref_links (set "in-reply-to" text)) 84 86 ^ opt_kv "Referred by:" (try 85 87 ref_links (Conversion.Id_map.find text.id conversion.Conversion.references) 86 88 with Not_found -> "") 89 ^ opt_kv "Replies:" (try 90 ref_links (Conversion.Id_map.find text.id conversion.Conversion.replies) 91 with Not_found -> "empty replies") 87 92 ^ {|</dl></header><pre style="white-space:pre-wrap">|} in 88 93 wrap conversion htm text.title ((T.of_string text.body header) ^ "</pre></article>")
Note:
See TracChangeset
for help on using the changeset viewer.