Changeset 61 in code for trunk/cli/atom.ml
- Timestamp:
- Apr 1, 2024, 2:01:11 PM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cli/atom.ml
r26 r61 12 12 module P = Parsers.Plain_text.Make (Converter.Html) 13 13 14 let id txt = "<id>urn: uuid:" ^ Logarion.(txt.Text.id) ^ "</id>"14 let id txt = "<id>urn:txtid:" ^ Logarion.(txt.Text.id) ^ "</id>" 15 15 let title text = "<title>" ^ esc text.Logarion.Text.title ^ "</title>" 16 16 … … 30 30 let open Logarion in 31 31 let u = Text.short_id text in 32 "<entry> <link rel=\"alternate\" href=\"" ^ base_url ^ "/" ^ u ^ ".htm\" />"32 "<entry>\n<link rel=\"alternate\" href=\"" ^ base_url ^ "/" ^ u ^ ".htm\" />" 33 33 ^ title text ^ id text ^ updated text ^ authors text 34 34 ^ (opt_element "summary" @@ esc @@ Text.str "abstract" text) 35 ^ String_set.fold (fun elt a -> a ^ "<category term=\"" ^ esc elt ^ "\"/>") (Text.set "topics" text) "" 36 ^ "<content type=\"xhtml\"><div xmlns=\"http://www.w3.org/1999/xhtml\">" 37 ^ P.of_string text.body "" 38 ^ "</div></content></entry>\n" 35 ^ String_set.fold (fun elt a -> a ^ "<category term=\"" ^ esc elt ^ "\"/>\n") (Text.set "topics" text) "" 36 ^ "</entry>\n" 39 37 40 38 let gmi_entry base_url text = 41 39 let open Logarion in 42 40 let u = Text.short_id text in 43 "<entry> <link rel=\"alternate\" href=\"" ^ base_url ^ "/" ^ u ^ ".gmi\" />"41 "<entry>\n<link rel=\"alternate\" href=\"" ^ base_url ^ "/" ^ u ^ ".gmi\" />\n" 44 42 ^ title text ^ id text ^ updated text ^ authors text 45 43 ^ (opt_element "summary" @@ esc @@ Text.str "abstract" text) 46 ^ String_set.fold (fun elt a -> a ^ "<category term=\"" ^ elt ^ "\"/> ") (Text.set "topics" text) ""44 ^ String_set.fold (fun elt a -> a ^ "<category term=\"" ^ elt ^ "\"/>\n") (Text.set "topics" text) "" 47 45 ^ "</entry>\n" 48 46 … … 66 64 ^ title ^ {|</title><link rel="alternate" type="|} ^ alternate_type ^ {|" href="|} 67 65 ^ base_url ^ {|/" /><link rel="self" type="application/atom+xml" href="|} 68 ^ self ^ {|" /><id>urn: uuid:|} ^ c.Conversion.id ^ "</id><updated>"66 ^ self ^ {|" /><id>urn:txtid:|} ^ c.Conversion.id ^ "</id><updated>" 69 67 ^ Logarion.Date.now () ^ "</updated>\n" 70 68 ^ List.fold_left (fun acc t -> acc ^ entry base_url t) "" c.texts
Note:
See TracChangeset
for help on using the changeset viewer.