Changeset 39 in code for trunk/cli/html.ml
- Timestamp:
- Dec 12, 2022, 10:52:55 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cli/html.ml
r38 r39 26 26 with Not_found -> if Sys.file_exists (Filename.concat conv.Conversion.dir "feed.atom") 27 27 then "feed.atom" else "" in 28 let header = match htm.templates.header with 28 let header = match htm.templates.header with 29 29 | Some x -> replace x 30 30 | None -> Printf.(sprintf "<header><a href='.'>%s</a>%s</header>" site_title … … 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 u 49 50 let angled_uri u a = 50 51 if try String.sub u 0 10 = "urn:txtid:" with Invalid_argument _ -> false … … 70 71 String_set.fold to_linked x "" in 71 72 let ref_links x = 72 let link l = HtmlConverter. angled_uri (String.(sub l 1 (length l-2)))"" in73 let link l = HtmlConverter.uid_uri l "" in 73 74 String_set.fold (fun r a -> sep_append a (link r)) x "" 74 75 in … … 80 81 ^ opt_kv "Topics:" (topic_links (set "topics" text)) 81 82 ^ opt_kv "Id:" text.id 82 ^ opt_kv "References:" (ref_links (set "references" text)) 83 ^ opt_kv "Refers:" (ref_links (set "references" text)) 84 ^ opt_kv "Referred by:" (try 85 ref_links (Conversion.Id_map.find text.id conversion.Conversion.references) 86 with Not_found -> "") 83 87 ^ {|</dl></header><pre style="white-space:pre-wrap">|} in 84 88 wrap conversion htm text.title ((T.of_string text.body header) ^ "</pre></article>")
Note:
See TracChangeset
for help on using the changeset viewer.