Changeset 48 in code
- Timestamp:
- Oct 18, 2023, 9:49:13 PM (18 months ago)
- Location:
- trunk
- Files:
-
- 13 added
- 3 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile
r47 r48 3 3 DATE=`date -r _build/default/cli/txt.exe +%Y%m%d` 4 4 COMMIT=`git rev-parse --short HEAD` 5 6 CC=cc 7 LD=cc 5 8 6 9 all: … … 17 20 18 21 dist: 19 dune subst20 22 dune build 21 23 cp _build/default/cli/txt.exe txt.exe -
trunk/cli/html.ml
r43 r48 28 28 let header = match htm.templates.header with 29 29 | Some x -> replace x 30 | None -> Printf.(sprintf "< header><a href='.'>%s</a>%s</header>" site_title31 (if feed <> "" then sprintf "< nav><a href='%s' id='feed'>feed</a></nav>" feed else ""))30 | None -> Printf.(sprintf "<a href='.'>%s</a>%s" site_title 31 (if feed <> "" then sprintf "<a href='%s' id='feed'>feed</a>" feed else "")) 32 32 in 33 33 let footer = match htm.templates.footer with None -> "" | Some x -> replace x in 34 Printf.sprintf "<!DOCTYPE HTML><html><head><title>%s%s</title>\n%s\n%s\ 35 <meta charset='utf-8'/><meta name='viewport' content='width=device-width, initial-scale=1.0'>\ 36 </head><body>\n%s%s%s</body></html>" 34 Printf.sprintf "<!DOCTYPE HTML PUBLIC \"//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head><title>%s%s</title>\n%s\n%s\ 35 <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\"></head><body>\n%s%s%s</body></html>" 37 36 text_title (if site_title <> "" then (" • " ^ site_title) else "") 38 37 htm.style … … 63 62 let authors = Person.Set.to_string text.authors in 64 63 let header = 65 let time x = Printf.sprintf {|< time datetime="%s">%s</time>|}64 let time x = Printf.sprintf {|<span class="%s">%s</span>|} 66 65 (Date.rfc_string x) (Date.pretty_date x) in 67 66 let topic_links x = … … 80 79 ref_links ref_set, ref_links rep_set 81 80 in 82 "< article><header><dl>"81 "<dl>" 83 82 ^ opt_kv "Title:" text.title 84 83 ^ opt_kv "Authors:" authors … … 91 90 ^ opt_kv "Referred by:" references 92 91 ^ opt_kv "Replies:" replies 93 ^ {|</dl>< /header><pre style="white-space:pre-wrap">|} in94 wrap conversion htm text.title ((T.of_string text.body header) ^ "</pre> </article>")92 ^ {|</dl><pre style="white-space:pre-wrap">|} in 93 wrap conversion htm text.title ((T.of_string text.body header) ^ "</pre>") 95 94 96 95 let to_dated_links ?(limit) meta_list = … … 116 115 let fold_topic_roots topic_roots = 117 116 let list_item root t = "<li>" ^ topic_link root t in 118 "< nav><h2>Main topics</h2>"117 "<h2>Main topics</h2>" 119 118 ^ List.fold_left (fun a x -> a ^ list_item x x) "<ul>" (List.rev topic_roots) 120 ^ "</ul> </nav>"119 ^ "</ul>" 121 120 122 121 let fold_topics topic_map topic_roots metas = … … 135 134 "<li>" ^ item ^ sub_items root t 136 135 in 137 "< nav><h2>Topics</h2>"136 "<h2>Topics</h2>" 138 137 ^ List.fold_left (fun a x -> a ^ list_item x x) "<ul>" (List.rev topic_roots) 139 ^ "</ul> </nav>"138 ^ "</ul>" 140 139 141 140 let text_item path meta = 142 141 let open Logarion in 143 "< time>" ^ Date.(pretty_date (listing meta.Text.date))144 ^ {|</ time> <a href="|} ^ path ^ Text.short_id meta ^ {|.htm">|} ^ meta.Text.title142 "<span>" ^ Date.(pretty_date (listing meta.Text.date)) 143 ^ {|</span> <a href="|} ^ path ^ Text.short_id meta ^ {|.htm">|} ^ meta.Text.title 145 144 ^ "</a><br>" 146 145 … … 162 161 | x -> {|<h2 id="|} ^ topic ^ {|">|} ^ String.capitalize_ascii topic ^ "</h2>" ^ x 163 162 in 164 "< nav><h1>Texts</h1>" ^ item_group topic_roots ^ "</nav>"163 "<h1>Texts</h1>" ^ item_group topic_roots ^ "" 165 164 166 165 let topic_main_index conv htm topic_roots metas = 167 166 wrap conv htm "Topics" 168 167 (fold_topic_roots topic_roots 169 ^ "< nav><h1>Latest</h1><ul>" ^ to_dated_links ~limit:8 metas168 ^ "<h1>Latest</h1><ul>" ^ to_dated_links ~limit:8 metas 170 169 ^ {|</ul><a href="index.date.htm">More by date</a>|} 171 170 ^ let peers = try Logarion.Store.KV.find "Peers" conv.kv with Not_found -> "" in -
trunk/cli/txt.ml
r47 r48 1 let version = " 9333d0e-dirty"1 let version = "1.2" 2 2 3 3 open Cmdliner -
trunk/dune-project
r47 r48 1 1 (lang dune 2.0) 2 2 (name logarion) 3 (version 9333d0e-dirty)3 (version 1.3) 4 4 (license EUPL-1.2) 5 (maintainers "Izuru Yakumo < yakumo.izuru@chaotic.ninja>")5 (maintainers "Izuru Yakumo <novaburst@envs.net>") 6 6 (homepage "https://logarion.chaotic.ninja") 7 7 (source (uri git+https://git.chaotic.ninja/yakumo.izuru/logarion.git)) -
trunk/logarion.opam
r47 r48 1 1 # This file is generated by dune, edit dune-project instead 2 2 opam-version: "2.0" 3 version: " 9333d0e-dirty"3 version: "1.2" 4 4 synopsis: "Texts archival and exchange" 5 maintainer: ["Izuru Yakumo < yakumo.izuru@chaotic.ninja>"]5 maintainer: ["Izuru Yakumo <novaburst@envs.net>"] 6 6 license: "EUPL-1.2" 7 7 homepage: "https://logarion.chaotic.ninja"
Note:
See TracChangeset
for help on using the changeset viewer.