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


Ignore:
Timestamp:
Dec 18, 2022, 2:49:25 PM (2 years ago)
Author:
fox
Message:

Relation dates, with conversion condition upon it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/html.ml

    r42 r43  
    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);
     76                let references, replies = let open Conversion in
     77                        let Rel.{ref_set; rep_set; _} =
     78                                try Rel.Id_map.find text.id conversion.relations
     79                                with Not_found -> Rel.empty in
     80                        ref_links ref_set, ref_links rep_set
     81                in
    7782                "<article><header><dl>"
    7883                ^ opt_kv "Title:" text.title
     
    8489                ^ opt_kv "Refers:" (ref_links (set "references" text))
    8590                ^ opt_kv "In reply to:" (ref_links (set "in-reply-to" text))
    86                 ^ opt_kv "Referred by:" (try
    87                                 ref_links (Conversion.Id_map.find text.id conversion.Conversion.references)
    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 -> "")
     91                ^ opt_kv "Referred by:" references
     92                ^ opt_kv "Replies:" replies
    9293                ^ {|</dl></header><pre style="white-space:pre-wrap">|} in
    9394        wrap conversion htm text.title ((T.of_string text.body header) ^ "</pre></article>")
Note: See TracChangeset for help on using the changeset viewer.