Changeset 19 in code for trunk/cli/gemini.ml


Ignore:
Timestamp:
Oct 26, 2022, 7:36:02 PM (2 years ago)
Author:
fox
Message:

Accept comma separated converter names, separate Atom from Html and Gemini converters.

Note: atom must be called separately now because of the separation. Example

txt convert -t htm,atom xyz

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/gemini.ml

    r15 r19  
    9191        let index_name = try Store.KV.find "Gemini-index" r.kv with Not_found -> "index.gmi" in
    9292        let title = try Store.KV.find "Title" r.Conversion.kv with Not_found -> "" in
    93 
    94         if index_name <> "" then
    95                 file index_name (topic_main_index r title r.topic_roots r.texts);
    96 
     93        if index_name <> "" then file index_name (topic_main_index r title r.topic_roots r.texts);
    9794        file "index.date.gmi" (date_index title r.texts);
    98 
    9995        List.iter
    10096                (fun topic -> file ("index." ^ topic ^ ".gmi")
    10197                 (topic_sub_index title r.topics topic r.texts))
    102                 r.topic_roots;
     98                r.topic_roots
    10399
    104         let base_url = try
    105                 let _i = Str.(search_forward (regexp "gemini?://[^;]*") (Store.KV.find "Locations" r.kv) 0) in
    106                 Str.(matched_string (Store.KV.find "Locations" r.kv))
    107                 with Not_found -> prerr_endline "Missing location for Gemini"; "" in
    108         file "gmi.atom" (Atom.feed title r.id base_url "text/gemini" r.texts)
     100let converter = Conversion.{ ext; page = Some page; indices = Some indices}
Note: See TracChangeset for help on using the changeset viewer.