Changeset 61 in code for trunk/cli


Ignore:
Timestamp:
Apr 1, 2024, 2:01:11 PM (13 months ago)
Author:
yakumo.izuru
Message:

Fix RSS/Atom generation for Gemini and HTTP, remove the txt publish feature

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

Location:
trunk/cli
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/atom.ml

    r26 r61  
    1212module P = Parsers.Plain_text.Make (Converter.Html)
    1313
    14 let id txt = "<id>urn:uuid:" ^ Logarion.(txt.Text.id) ^ "</id>"
     14let id txt = "<id>urn:txtid:" ^ Logarion.(txt.Text.id) ^ "</id>"
    1515let title text = "<title>" ^ esc text.Logarion.Text.title ^ "</title>"
    1616
     
    3030  let open Logarion in
    3131  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\" />"
    3333  ^ title text ^ id text ^ updated text ^ authors text
    3434  ^ (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"
    3937
    4038let gmi_entry base_url text =
    4139  let open Logarion in
    4240  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"
    4442  ^ title text ^ id text ^ updated text ^ authors text
    4543  ^ (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) ""
    4745  ^ "</entry>\n"
    4846
     
    6664          ^ title ^ {|</title><link rel="alternate" type="|} ^ alternate_type ^ {|" href="|}
    6765          ^ 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>"
    6967          ^ Logarion.Date.now () ^ "</updated>\n"
    7068          ^ List.fold_left (fun acc t -> acc ^ entry base_url t) "" c.texts
  • trunk/cli/dune

    r43 r61  
    33 (public_name txt)
    44 (modules txt authors convert conversion edit file index last listing
    5   new topics html atom gemini peers publish pull read recent)
     5  new topics html atom gemini peers pull read recent)
    66 (libraries text_parse.converter text_parse.parsers logarion msgpck curl str cmdliner))
  • trunk/cli/txt.ml

    r60 r61  
    1 let version = "1.3.1"
     1let version = "1.3.2"
    22
    33open Cmdliner
    44let default_cmd =
    55        let doc = "Discover, collect & exchange texts" in
    6         let man = [ `S "CONTACT"; `P "<mailto:logarion@lists.tildeverse.org?subject=Logarion>" ] in
     6        let man = [ `S "CONTACT"; `P "<mailto:logarion-dev@chaotic.ninja>" ] in
    77        Term.(ret (const (`Help (`Pager, None)))), Term.info "txt" ~version ~doc ~man
    88
     
    1717        New.term;
    1818        Peers.term;
    19         Publish.term;
    2019        Pull.term;
    2120        Read.term;
Note: See TracChangeset for help on using the changeset viewer.