Make the atom feed more palatable

Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: file:///srv/svn/repo/kosuzu/trunk@63 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
yakumo.izuru 2024-04-01 15:49:44 +00:00
parent 717edc5d79
commit a0af8ffc4a
2 changed files with 6 additions and 6 deletions

View File

@ -11,8 +11,8 @@ let opt_element tag_name content =
module P = Parsers.Plain_text.Make (Converter.Html)
let id txt = "<id>urn:txtid:" ^ Logarion.(txt.Text.id) ^ "</id>"
let title text = "<title>" ^ esc text.Logarion.Text.title ^ "</title>"
let id txt = "<id>urn:txtid:" ^ Logarion.(txt.Text.id) ^ "</id>\n"
let title text = "<title>" ^ esc text.Logarion.Text.title ^ "</title>\n"
let authors text =
let u acc addr = acc ^ element "uri" addr in
@ -20,16 +20,16 @@ let authors text =
let fn txt a =
a ^ "<author>" ^ (opt_element "name" @@ esc txt.Person.name)
^ (List.fold_left u "" txt.Person.addresses)
^ "</author>" in
^ "</author>\n" in
Person.Set.fold fn text.Text.authors ""
let updated txt = let open Logarion in
"<updated>"^ Date.(txt.Text.date |> listing |> rfc_string) ^"</updated>"
"<updated>"^ Date.(txt.Text.date |> listing |> rfc_string) ^"</updated>\n"
let htm_entry base_url text =
let open Logarion in
let u = Text.short_id text in
"<entry>\n<link rel=\"alternate\" href=\"" ^ base_url ^ "/" ^ u ^ ".htm\" />"
"<entry>\n<link rel=\"alternate\" href=\"" ^ base_url ^ "/" ^ u ^ ".htm\" />\n"
^ title text ^ id text ^ updated text ^ authors text
^ (opt_element "summary" @@ esc @@ Text.str "abstract" text)
^ String_set.fold (fun elt a -> a ^ "<category term=\"" ^ esc elt ^ "\"/>\n") (Text.set "topics" text) ""

View File

@ -6,7 +6,7 @@ maintainer: ["Izuru Yakumo <yakumo.izuru@chaotic.ninja>"]
authors: ["orbifx <fox@orbitalfox.eu>"]
license: "EUPL-1.2"
homepage: "https://logarion.chaotic.ninja"
bug-reports: "mailto:logarion@lists.tildeverse.org"
bug-reports: "mailto:logarion-dev@chaotic.ninja"
depends: [
"dune" {>= "2.0"}
"cmdliner" {<= "1.0.4"}