Fix non-empty authors in HTML conversion
This commit is contained in:
parent
cc7515bfac
commit
671f5b5390
12
cli/html.ml
12
cli/html.ml
|
@ -58,7 +58,7 @@ let page htm conversion text =
|
||||||
let opt_kv key value = if String.length value > 0
|
let opt_kv key value = if String.length value > 0
|
||||||
then "<dt>" ^ key ^ "<dd>" ^ value else "" in
|
then "<dt>" ^ key ^ "<dd>" ^ value else "" in
|
||||||
(* let author acc auth = sep_append acc Person.(auth.name ^ " ") in*)
|
(* let author acc auth = sep_append acc Person.(auth.name ^ " ") in*)
|
||||||
let authors = (Person.Set.to_string text.authors ^ " ") in
|
let authors = Person.Set.to_string text.authors in
|
||||||
let keywords = str_set "keywords" text in
|
let keywords = str_set "keywords" text in
|
||||||
let header =
|
let header =
|
||||||
let time x = Printf.sprintf {|<time datetime="%s">%s</time>|}
|
let time x = Printf.sprintf {|<time datetime="%s">%s</time>|}
|
||||||
|
@ -71,11 +71,11 @@ let page htm conversion text =
|
||||||
"<article><header><dl>"
|
"<article><header><dl>"
|
||||||
^ opt_kv "Title:" text.title
|
^ opt_kv "Title:" text.title
|
||||||
^ opt_kv "Authors:" authors
|
^ opt_kv "Authors:" authors
|
||||||
^ opt_kv "Date: " (time (Date.listing text.date))
|
^ opt_kv "Date:" (time (Date.listing text.date))
|
||||||
^ opt_kv "Series: " (str_set "series" text)
|
^ opt_kv "Series:" (str_set "series" text)
|
||||||
^ opt_kv "Topics: " (topic_links (set "topics" text))
|
^ opt_kv "Topics:" (topic_links (set "topics" text))
|
||||||
^ opt_kv "Keywords: " keywords
|
^ opt_kv "Keywords:" keywords
|
||||||
^ opt_kv "Id: " text.id
|
^ opt_kv "Id:" text.id
|
||||||
^ {|</dl></header><pre style="white-space:pre-wrap">|} in
|
^ {|</dl></header><pre style="white-space:pre-wrap">|} in
|
||||||
wrap conversion htm text.title ((T.of_string text.body header) ^ "</pre></article>")
|
wrap conversion htm text.title ((T.of_string text.body header) ^ "</pre></article>")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue