Index: /trunk/Makefile
===================================================================
--- /trunk/Makefile	(revision 47)
+++ /trunk/Makefile	(revision 48)
@@ -3,4 +3,7 @@
 DATE=`date -r _build/default/cli/txt.exe +%Y%m%d`
 COMMIT=`git rev-parse --short HEAD`
+
+CC=cc
+LD=cc
 
 all:
@@ -17,5 +20,4 @@
 
 dist:
-	dune subst
 	dune build
 	cp _build/default/cli/txt.exe txt.exe
Index: /trunk/README.md
===================================================================
--- /trunk/README.md	(revision 48)
+++ /trunk/README.md	(revision 48)
@@ -0,0 +1,16 @@
+# Logarion
+Text archival and exchange.
+
+## Contact
+* [Mailing list](https://lists.tildeverse.org/postorius/lists/logarion.lists.tildeverse.org/)
+
+## References
+* [Building from source](https://logarion.chaotic.ninja/9egbae.htm)
+* [Creating texts & publishing on the net](https://logarion.chaotic.ninja/hvhhwf.htm)
+* [Exploring & pulling texts from Logarion repositories](https://logarion.chaotic.ninja/3sqd84.htm)
+* [Header format](https://logarion.chaotic.ninja/d41e68.htm)
+* [Txt uniform resource names](https://logarion.chaotic.ninja/h1a9tg.htm)
+
+## Maintainers
+* orbifx (original author, former maintainer)
+* Izuru Yakumo (contributor, current maintainer)
Index: /trunk/cli/html.ml
===================================================================
--- /trunk/cli/html.ml	(revision 47)
+++ /trunk/cli/html.ml	(revision 48)
@@ -28,11 +28,10 @@
 	let header = match htm.templates.header with
 		| Some x -> replace x
-		| None -> Printf.(sprintf "<header><a href='.'>%s</a>%s</header>" site_title
-				(if feed <> "" then sprintf "<nav><a href='%s' id='feed'>feed</a></nav>" feed else ""))
+		| None -> Printf.(sprintf "<a href='.'>%s</a>%s" site_title
+				(if feed <> "" then sprintf "<a href='%s' id='feed'>feed</a>" feed else ""))
 	in
 	let footer = match htm.templates.footer with None -> "" | Some x -> replace x in
-	Printf.sprintf "<!DOCTYPE HTML><html><head><title>%s%s</title>\n%s\n%s\
-	<meta charset='utf-8'/><meta name='viewport' content='width=device-width, initial-scale=1.0'>\
-	</head><body>\n%s%s%s</body></html>"
+	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\
+	<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>"
 	text_title (if site_title <> "" then (" • " ^ site_title) else "")
 	htm.style
@@ -63,5 +62,5 @@
 	let authors = Person.Set.to_string text.authors in
 	let header =
-		let time x = Printf.sprintf {|<time datetime="%s">%s</time>|}
+		let time x = Printf.sprintf {|<span class="%s">%s</span>|}
 			(Date.rfc_string x) (Date.pretty_date x) in
 		let topic_links x =
@@ -80,5 +79,5 @@
 			ref_links ref_set, ref_links rep_set
 		in
-		"<article><header><dl>"
+		"<dl>"
 		^ opt_kv "Title:" text.title
 		^ opt_kv "Authors:" authors
@@ -91,6 +90,6 @@
 		^ opt_kv "Referred by:" references
 		^ opt_kv "Replies:" replies
-		^ {|</dl></header><pre style="white-space:pre-wrap">|} in
-	wrap conversion htm text.title ((T.of_string text.body header) ^ "</pre></article>")
+		^ {|</dl><pre style="white-space:pre-wrap">|} in
+	wrap conversion htm text.title ((T.of_string text.body header) ^ "</pre>")
 
 let to_dated_links ?(limit) meta_list =
@@ -116,7 +115,7 @@
 let fold_topic_roots topic_roots =
 	let list_item root t = "<li>" ^ topic_link root t in
-	"<nav><h2>Main topics</h2>"
+	"<h2>Main topics</h2>"
 	^ List.fold_left (fun a x -> a ^ list_item x x) "<ul>" (List.rev topic_roots)
-	^ "</ul></nav>"
+	^ "</ul>"
 
 let fold_topics topic_map topic_roots metas =
@@ -135,12 +134,12 @@
 		"<li>" ^ item ^ sub_items root t
 	in
-	"<nav><h2>Topics</h2>"
+	"<h2>Topics</h2>"
 	^ List.fold_left (fun a x -> a ^ list_item x x) "<ul>" (List.rev topic_roots)
-	^ "</ul></nav>"
+	^ "</ul>"
 
 let text_item path meta =
 	let open Logarion in
-	"<time>" ^ Date.(pretty_date (listing meta.Text.date))
-	^ {|</time> <a href="|} ^ path ^ Text.short_id meta ^ {|.htm">|} ^ meta.Text.title
+	"<span>" ^ Date.(pretty_date (listing meta.Text.date))
+	^ {|</span> <a href="|} ^ path ^ Text.short_id meta ^ {|.htm">|} ^ meta.Text.title
 	^ "</a><br>"
 
@@ -162,10 +161,10 @@
 		| x -> {|<h2 id="|} ^ topic ^ {|">|} ^ String.capitalize_ascii topic ^ "</h2>" ^ x
 	in
-	"<nav><h1>Texts</h1>" ^ item_group topic_roots ^ "</nav>"
+	"<h1>Texts</h1>" ^ item_group topic_roots ^ ""
 
 let topic_main_index conv htm topic_roots metas =
 	wrap conv htm "Topics"
 		(fold_topic_roots topic_roots
-		^ "<nav><h1>Latest</h1><ul>" ^ to_dated_links ~limit:8 metas
+		^ "<h1>Latest</h1><ul>" ^ to_dated_links ~limit:8 metas
 		^ {|</ul><a href="index.date.htm">More by date</a>|}
 		^ let peers = try Logarion.Store.KV.find "Peers" conv.kv with Not_found -> "" in
Index: /trunk/cli/txt.ml
===================================================================
--- /trunk/cli/txt.ml	(revision 47)
+++ /trunk/cli/txt.ml	(revision 48)
@@ -1,3 +1,3 @@
-let version = "9333d0e-dirty"
+let version = "1.2"
 
 open Cmdliner
Index: /trunk/dune-project
===================================================================
--- /trunk/dune-project	(revision 47)
+++ /trunk/dune-project	(revision 48)
@@ -1,7 +1,7 @@
 (lang dune 2.0)
 (name logarion)
-(version 9333d0e-dirty)
+(version 1.3)
 (license EUPL-1.2)
-(maintainers "Izuru Yakumo <yakumo.izuru@chaotic.ninja>")
+(maintainers "Izuru Yakumo <novaburst@envs.net>")
 (homepage "https://logarion.chaotic.ninja")
 (source (uri git+https://git.chaotic.ninja/yakumo.izuru/logarion.git))
Index: unk/header
===================================================================
--- /trunk/header	(revision 47)
+++ 	(revision )
@@ -1,20 +1,0 @@
-ID:      Unique identifier
-Date:    ISO8601 date of creation
-Topics:  Comma seperated list of topic names & phrases
-Title:   A title for the text, ideally less than 70 characters   
-Authors: List of name with optional set of <address>
-Date-edited: ISO8601, use only when text edited
-References: list of text ID links
-
-A blank line must follow the last header field.
-
-
-Example
-
-ID: 11bcd
-Title: A Logarion exemplar header
-Authors: John Doe <http://example.com> <jd@example.com>
-Date: 1970-11-06T12:29:50-00:00
-Topic: Logarion, examples
-
-Hello world!
Index: unk/install
===================================================================
--- /trunk/install	(revision 47)
+++ 	(revision )
@@ -1,6 +1,0 @@
-Install development version
-
-Requirements are ocaml (the compiler) and opam (the package manager). Then run:
-
-	opam pin add logarion https://git.disroot.org/orbifx/logarion.git
-	opam install logarion
Index: /trunk/logarion.opam
===================================================================
--- /trunk/logarion.opam	(revision 47)
+++ /trunk/logarion.opam	(revision 48)
@@ -1,7 +1,7 @@
 # This file is generated by dune, edit dune-project instead
 opam-version: "2.0"
-version: "9333d0e-dirty"
+version: "1.2"
 synopsis: "Texts archival and exchange"
-maintainer: ["Izuru Yakumo <yakumo.izuru@chaotic.ninja>"]
+maintainer: ["Izuru Yakumo <novaburst@envs.net>"]
 license: "EUPL-1.2"
 homepage: "https://logarion.chaotic.ninja"
Index: unk/readme.txt
===================================================================
--- /trunk/readme.txt	(revision 47)
+++ 	(revision )
@@ -1,28 +1,0 @@
-ID: ka4wtj
-Title: Logarion
-
-## Guides
-
-Exploring & pulling texts from Logarion repositories.
-<urn:txtid:3sqd84>
-
-Creating texts & publishing on the net.
-<urn:txtid:hvhhwf>
-
-Txt uniform resource names
-<urn:txtid:h1a9tg>
-
-Building from source
-<urn:txtid:9egbae>
-
-## Contacts
-Mailing list (anonymous): 📧
-<https://lists.tildeverse.org/postorius/lists/logarion.lists.tildeverse.org/>
-
-## References
-* Source <http://git.chaotic.ninja/yakumo.izuru/logarion>
-* Header format <http://git.chaotic.ninja/yakumo.izuru/logarion/raw/branch/master/header>
-
-## Maintainers
-* orbifx (formerly)
-* Izuru Yakumo (current)
Index: /trunk/txt/d41e68.txt
===================================================================
--- /trunk/txt/d41e68.txt	(revision 48)
+++ /trunk/txt/d41e68.txt	(revision 48)
@@ -0,0 +1,26 @@
+ID: d41e68
+Date: 2023-10-18T18:45:33+00:00
+Title: Header format
+Authors: orbifx <fox@orbitalfox.eu>
+
+
+ID:      Unique identifier
+Date:    ISO8601 date of creation
+Topics:  Comma seperated list of topic names & phrases
+Title:   A title for the text, ideally less than 70 characters   
+Authors: List of name with optional set of <address>
+Date-edited: ISO8601, use only when text edited
+References: list of text ID links
+
+A blank line must follow the last header field.
+
+
+Example
+
+ID: 11bcd
+Title: A Logarion exemplar header
+Authors: John Doe <http://example.com> <jd@example.com>
+Date: 1970-11-06T12:29:50-00:00
+Topic: Logarion, examples
+
+Hello world!
Index: /trunk/txt/footer.html
===================================================================
--- /trunk/txt/footer.html	(revision 48)
+++ /trunk/txt/footer.html	(revision 48)
@@ -0,0 +1,4 @@
+<hr>
+<p>
+<a href="https://git.chaotic.ninja/yakumo.izuru/logarion">Source code</a>
+</p>
Index: /trunk/txt/header.html
===================================================================
--- /trunk/txt/header.html	(revision 48)
+++ /trunk/txt/header.html	(revision 48)
@@ -0,0 +1,2 @@
+<h1>Logarion</h1>
+<p>discover, collect &amp; exchange plain text files</p>
Index: /trunk/txt/htm/3sqd84.txt
===================================================================
--- /trunk/txt/htm/3sqd84.txt	(revision 48)
+++ /trunk/txt/htm/3sqd84.txt	(revision 48)
@@ -0,0 +1,10 @@
+ID: 3sqd84
+Date: 2022-11-06T13:01:19Z
+Title: Exploring & pulling texts from Logarion repositories
+Authors: orbifx
+
+Logarion repositories are collections of text files, accompanied by a special index file. These collections can exist on any server and accessed by any transport protocol. Logarion's client currently supports a plethora of protocols, HTTP, FTP, Gopher to name a few examples.
+
+A remote repository can be registered and texts copied locally. To add a new remote run: `txt pull <url>`, where <url> is the address of the remote repository. The program will connect to the server, copy the `index.pck` file and use it to download each text file. It will not redownload previous texts, unless their Date or Date-Edited dates are newer than the previous ones.
+
+The text files are by default downloaded to `.local/share/texts/peers/`. A new directory is created for each peer's unique id and the index & texts are stored in it. Running `txt pull` with no URL, will refetch indices from all previously pulled repositories, and new text files will be downloaded automatically.
Index: /trunk/txt/htm/9egbae.txt
===================================================================
--- /trunk/txt/htm/9egbae.txt	(revision 48)
+++ /trunk/txt/htm/9egbae.txt	(revision 48)
@@ -0,0 +1,14 @@
+ID: 9egbae
+Date: 2023-06-17T23:27:44Z
+Title: Building from source
+Authors: yakumo_izuru
+
+Requirements:
+* git
+* ocaml (>=4.13)
+
+1. git clone https://git.chaotic.ninja/yakumo.izuru/logarion.git
+2. cd logarion
+3. git submodule update --init
+4. make deps
+5. make tgz
Index: /trunk/txt/htm/d41e68.txt
===================================================================
--- /trunk/txt/htm/d41e68.txt	(revision 48)
+++ /trunk/txt/htm/d41e68.txt	(revision 48)
@@ -0,0 +1,26 @@
+ID: d41e68
+Date: 2023-10-18T18:45:33+00:00
+Title: Header format
+Authors: orbifx <fox@orbitalfox.eu>
+
+
+ID:      Unique identifier
+Date:    ISO8601 date of creation
+Topics:  Comma seperated list of topic names & phrases
+Title:   A title for the text, ideally less than 70 characters   
+Authors: List of name with optional set of <address>
+Date-edited: ISO8601, use only when text edited
+References: list of text ID links
+
+A blank line must follow the last header field.
+
+
+Example
+
+ID: 11bcd
+Title: A Logarion exemplar header
+Authors: John Doe <http://example.com> <jd@example.com>
+Date: 1970-11-06T12:29:50-00:00
+Topic: Logarion, examples
+
+Hello world!
Index: /trunk/txt/htm/h1a9tg.txt
===================================================================
--- /trunk/txt/htm/h1a9tg.txt	(revision 48)
+++ /trunk/txt/htm/h1a9tg.txt	(revision 48)
@@ -0,0 +1,16 @@
+ID: h1a9tg
+Date: 2022-11-20T13:28:57Z
+Authors: orbifx <orbifx@orbifx.indy>
+Title: Txt uniform resource names
+
+Logarion texts are transport agnostic. URIs should therefore avoid using URLs and use URNs instead. Some definitions of Uniform Resource:
+- Locator (URL) <http://en.wikipedia.org/wiki/Url>
+- Identifier (URI) <http://en.wikipedia.org/wiki/Uniform_Resource_Identifier>
+- Name (URN) <http://en.wikipedia.org/wiki/Uniform_Resource_Name>
+
+
+Links enclosed in angled brackets <> of the format:
+
+    urn:txtid:abcdef
+
+where `abcdef` is the id of the text are understood by `txt` and handled accordingly. For example when converting to HTML or Gemini, the URNs are converted to relative URLs which browsers can understand.
Index: /trunk/txt/htm/hvhhwf.txt
===================================================================
--- /trunk/txt/htm/hvhhwf.txt	(revision 48)
+++ /trunk/txt/htm/hvhhwf.txt	(revision 48)
@@ -0,0 +1,76 @@
+ID: hvhhwf
+Date: 2022-11-06T13:19:57Z
+Title: Creating texts & publishing on the net
+Authors: orbifx
+
+# New
+
+To create new text files, use "txt new". For example:
+	txt new "Hello world"
+It's important to enclose the title with quotation marks if it contains spaces. The command will return the filename of the new text. The filename starts with a part of the ID and the title of the text. Use the file name to open it with your text editor.
+
+Alternatively add the -i flag to have the text editor launched to edit the newly created file:
+	txt new -i "Some title"
+
+Text files will be stored in either:
+1. The directory pointed at by txtdir if defined
+2. $HOME/.local/share/texts, if directory exists
+3. The current working directory, if all else fails
+
+The simplest approach is to put all texts in the local-share directory and override that on occasion with 
+$txtdir. For example:
+	txtdir=. txt new "Hello world"
+
+
+# Publish
+
+Texts created with "new" are treated as personal until published. To publish a text, use `txt publish [id]` where [id] is the text of the text to publish. Publication requires a `txt.conf` file which must exist in either:
+1. The current working directory
+2. $HOME/.config/txt/txt.conf
+
+With the above in place, `txt publish [id]` will add the text file with [id] in the publication-directory and reproduce the `index.pck` in that directory. If Pubdir is not defined in `txt.conf` then the environmental variable `txtpubdir` is used. If that is also undefined, the current working directory is used as a publication directory.
+
+Logarion is protocol agnostic, so publish looks for the existence of directories to copy the files, ready for publication. At the time of writing the three directories are `public_html`, `public_gemini` and `public_gopher`. For each of these directories, `txt publish [id]` will copy the text file, revise the `index.pck` and also convert produce converted files, such .htm for public_html.
+
+## txt.conf keys
+
+Id:
+	A random, unique, alphanumeric string for distinguishing the repository (atleast 6 characters of Crockford's Base32 recommended)
+
+Title:
+	a human-friendly title
+
+Authors:
+	comma seperated list of names and, optionally, addresses
+
+Topics:
+	topics the repository aims to cover
+
+Locations:
+	list of URIs the repositories can be accessed
+
+Peers:
+	list of peer URIs
+
+Pubdir:
+	(optional) the directory that contains publication subdirectories
+
+
+## HTML
+
+There are some special settings for HTML publication:
+
+HTM-style:
+	path to a CSS style. It will be inserted in every .htm file. To link to a single CSS consider using `@import`
+
+HTM-header:
+	path to a file, inserted in every .htm file, right after the body tag
+
+HTM-footer:
+	path to a file, inserted in every .htm file, right before the body tag
+
+HTM-index:
+	if defined, determines the filename for the index files. Left undefined, defaults to `index.html`
+
+HTM-feed:
+	if defined, this will overrite the feed URI used in HTML files. If left undefined the default `feed.atom` is used
Index: /trunk/txt/htm/main.css
===================================================================
--- /trunk/txt/htm/main.css	(revision 48)
+++ /trunk/txt/htm/main.css	(revision 48)
@@ -0,0 +1,8 @@
+body{color:#111;background:#faeed6;margin:auto;padding:1ch;max-width:80ch}
+@media(min-resolution:130dpi){body{font-size:1.5em}}
+article>header{margin:auto;padding:1ch}
+dt{float:left;text-align:right;padding-right:1ch;min-width:8ch;opacity:0.4;clear:left}
+:target::before{content:"☞"}
+body>h1{font-family:cursive}
+h1,h2{color:#ff6600}
+h3,h4{color:#333}
Index: /trunk/txt/txt.conf
===================================================================
--- /trunk/txt/txt.conf	(revision 48)
+++ /trunk/txt/txt.conf	(revision 48)
@@ -0,0 +1,6 @@
+Id: 17f4e3
+Title: Logarion
+Authors: orbifx <fox@orbifalfox.eu>, Izuru Yakumo <yakumo.izuru@chaotic.ninja>
+HTM-style: main.css
+HTM-header: header.html
+HTM-footer: footer.html
