Changeset 48 in code


Ignore:
Timestamp:
Oct 18, 2023, 9:49:13 PM (18 months ago)
Author:
yakumo.izuru
Message:

Switch HTML doctype to 4.01 Transitional, update documentation

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

Location:
trunk
Files:
13 added
3 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r47 r48  
    33DATE=`date -r _build/default/cli/txt.exe +%Y%m%d`
    44COMMIT=`git rev-parse --short HEAD`
     5
     6CC=cc
     7LD=cc
    58
    69all:
     
    1720
    1821dist:
    19         dune subst
    2022        dune build
    2123        cp _build/default/cli/txt.exe txt.exe
  • trunk/cli/html.ml

    r43 r48  
    2828        let header = match htm.templates.header with
    2929                | Some x -> replace x
    30                 | None -> Printf.(sprintf "<header><a href='.'>%s</a>%s</header>" site_title
    31                                 (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 ""))
    3232        in
    3333        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>"
    3736        text_title (if site_title <> "" then (" • " ^ site_title) else "")
    3837        htm.style
     
    6362        let authors = Person.Set.to_string text.authors in
    6463        let header =
    65                 let time x = Printf.sprintf {|<time datetime="%s">%s</time>|}
     64                let time x = Printf.sprintf {|<span class="%s">%s</span>|}
    6665                        (Date.rfc_string x) (Date.pretty_date x) in
    6766                let topic_links x =
     
    8079                        ref_links ref_set, ref_links rep_set
    8180                in
    82                 "<article><header><dl>"
     81                "<dl>"
    8382                ^ opt_kv "Title:" text.title
    8483                ^ opt_kv "Authors:" authors
     
    9190                ^ opt_kv "Referred by:" references
    9291                ^ opt_kv "Replies:" replies
    93                 ^ {|</dl></header><pre style="white-space:pre-wrap">|} in
    94         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>")
    9594
    9695let to_dated_links ?(limit) meta_list =
     
    116115let fold_topic_roots topic_roots =
    117116        let list_item root t = "<li>" ^ topic_link root t in
    118         "<nav><h2>Main topics</h2>"
     117        "<h2>Main topics</h2>"
    119118        ^ List.fold_left (fun a x -> a ^ list_item x x) "<ul>" (List.rev topic_roots)
    120         ^ "</ul></nav>"
     119        ^ "</ul>"
    121120
    122121let fold_topics topic_map topic_roots metas =
     
    135134                "<li>" ^ item ^ sub_items root t
    136135        in
    137         "<nav><h2>Topics</h2>"
     136        "<h2>Topics</h2>"
    138137        ^ List.fold_left (fun a x -> a ^ list_item x x) "<ul>" (List.rev topic_roots)
    139         ^ "</ul></nav>"
     138        ^ "</ul>"
    140139
    141140let text_item path meta =
    142141        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.title
     142        "<span>" ^ Date.(pretty_date (listing meta.Text.date))
     143        ^ {|</span> <a href="|} ^ path ^ Text.short_id meta ^ {|.htm">|} ^ meta.Text.title
    145144        ^ "</a><br>"
    146145
     
    162161                | x -> {|<h2 id="|} ^ topic ^ {|">|} ^ String.capitalize_ascii topic ^ "</h2>" ^ x
    163162        in
    164         "<nav><h1>Texts</h1>" ^ item_group topic_roots ^ "</nav>"
     163        "<h1>Texts</h1>" ^ item_group topic_roots ^ ""
    165164
    166165let topic_main_index conv htm topic_roots metas =
    167166        wrap conv htm "Topics"
    168167                (fold_topic_roots topic_roots
    169                 ^ "<nav><h1>Latest</h1><ul>" ^ to_dated_links ~limit:8 metas
     168                ^ "<h1>Latest</h1><ul>" ^ to_dated_links ~limit:8 metas
    170169                ^ {|</ul><a href="index.date.htm">More by date</a>|}
    171170                ^ 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"
     1let version = "1.2"
    22
    33open Cmdliner
  • trunk/dune-project

    r47 r48  
    11(lang dune 2.0)
    22(name logarion)
    3 (version 9333d0e-dirty)
     3(version 1.3)
    44(license EUPL-1.2)
    5 (maintainers "Izuru Yakumo <yakumo.izuru@chaotic.ninja>")
     5(maintainers "Izuru Yakumo <novaburst@envs.net>")
    66(homepage "https://logarion.chaotic.ninja")
    77(source (uri git+https://git.chaotic.ninja/yakumo.izuru/logarion.git))
  • trunk/logarion.opam

    r47 r48  
    11# This file is generated by dune, edit dune-project instead
    22opam-version: "2.0"
    3 version: "9333d0e-dirty"
     3version: "1.2"
    44synopsis: "Texts archival and exchange"
    5 maintainer: ["Izuru Yakumo <yakumo.izuru@chaotic.ninja>"]
     5maintainer: ["Izuru Yakumo <novaburst@envs.net>"]
    66license: "EUPL-1.2"
    77homepage: "https://logarion.chaotic.ninja"
Note: See TracChangeset for help on using the changeset viewer.