Format improvements for Gemini output

This commit is contained in:
orbifx 2021-06-22 15:20:45 +01:00
parent 95b88a6768
commit 2f3d88a0c5

View File

@ -11,7 +11,7 @@ let date_index title meta_list =
(fun a m -> (fun a m ->
a ^ "=> " ^ Logarion.Text.alias m ^ ".gmi " ^ a ^ "=> " ^ Logarion.Text.alias m ^ ".gmi " ^
Logarion.(Date.(pretty_date (listing m.date)) ^ " " ^ m.title) ^ "\n") Logarion.(Date.(pretty_date (listing m.date)) ^ " " ^ m.title) ^ "\n")
("# " ^ title ^ "\n\n") meta_list ("# " ^ title ^ "\n\n## Posts by date\n\n") meta_list
let to_dated_links ?(limit) meta_list = let to_dated_links ?(limit) meta_list =
let meta_list = match limit with let meta_list = match limit with
@ -64,7 +64,7 @@ let fold_topic_roots topic_roots =
let topic_main_index title topic_roots metas = let topic_main_index title topic_roots metas =
"# " ^ title ^ "\n\n" "# " ^ title ^ "\n\n"
^ if topic_roots <> [] then ("## Main topics\n\n" ^ fold_topic_roots topic_roots) else "" ^ (if topic_roots <> [] then ("## Main topics\n\n" ^ fold_topic_roots topic_roots) else "")
^ "\n## Latest\n\n" ^ to_dated_links ~limit:10 metas ^ "\n## Latest\n\n" ^ to_dated_links ~limit:10 metas
^ "\n=> index.date.gmi More by date\n" ^ "\n=> index.date.gmi More by date\n"