Changeset 41 in code for trunk/cli/html.ml


Ignore:
Timestamp:
Dec 13, 2022, 11:04:19 PM (2 years ago)
Author:
fox
Message:

In-Reply-To header field. Note extra list.rev in convert

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/html.ml

    r39 r41  
    4040        header body footer
    4141
    42 let topic_link root topic = 
     42let topic_link root topic =
    4343        let replaced_space = String.map (function ' '->'+' | x->x) in
    4444        "<a href='index." ^ root ^ ".htm#" ^ replaced_space topic ^ "'>"
     
    4747module HtmlConverter = struct
    4848        include Converter.Html
    49         let uid_uri u a = Printf.sprintf "%s<a href='%s%s'>%s</a>" a u ext u
     49        let uid_uri u a = Printf.sprintf "%s<a href='%s%s'>&lt;%s&gt;</a>" a u ext u
    5050        let angled_uri u a =
    5151                if try String.sub u 0 10 = "urn:txtid:" with Invalid_argument _ -> false
     
    7474                        String_set.fold (fun r a -> sep_append a (link r)) x ""
    7575                in
     76                Printf.eprintf "%s %d\n" text.id (Conversion.Id_map.cardinal conversion.Conversion.replies);
    7677                "<article><header><dl>"
    7778                ^ opt_kv "Title:" text.title
     
    8283                ^ opt_kv "Id:" text.id
    8384                ^ opt_kv "Refers:" (ref_links (set "references" text))
     85                ^ opt_kv "In reply to:" (ref_links (set "in-reply-to" text))
    8486                ^ opt_kv "Referred by:" (try
    8587                                ref_links (Conversion.Id_map.find text.id conversion.Conversion.references)
    8688                                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")
    8792                ^ {|</dl></header><pre style="white-space:pre-wrap">|} in
    8893        wrap conversion htm text.title ((T.of_string text.body header) ^ "</pre></article>")
Note: See TracChangeset for help on using the changeset viewer.