diff --git a/.gitignore b/.gitignore index 93ee2a0..d5b1942 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ *~ *.o *.native -_build \ No newline at end of file +_build +*.htm diff --git a/Makefile b/Makefile index adda839..7bc747e 100644 --- a/Makefile +++ b/Makefile @@ -15,4 +15,11 @@ tgz: tar czvf "logarion-$(shell date -r _build/default/cli/cli.exe "+%y-%m-%d")-$(shell uname -s)-$(shell uname -m)-$(shell git rev-parse --short HEAD).tar.gz" txt readme rm txt +htm: + rm -f {3sqd84,hvhhwf,ka4wtj,h1a9tg}.htm + txt convert readme.txt -t htm + txt convert txt/3sqd84.txt -t htm + txt convert txt/hvhhwf.txt -t htm + txt convert txt/h1a9tg.txt -t htm + .PHONY: cli diff --git a/readme.txt b/readme.txt index d3a86fd..3b447c9 100644 --- a/readme.txt +++ b/readme.txt @@ -3,23 +3,17 @@ Title: Logarion ## Guides -Exploring & pulling texts from Logarion repositories. -<3sqd84.html> - -Creating texts & publishing on the net. - - +- Exploring & pulling texts from Logarion repositories. +- Creating texts & publishing on the net. +- Txt uniform resource names ## Contacts -* Mailing list (anonymous) -* +- Mailing list (anonymous) 📧 +- 💬 ## References -### Header format - - -### Source - +- Source +- Header format diff --git a/txt/3sqd84.txt b/txt/3sqd84.txt new file mode 100644 index 0000000..b6a1bf6 --- /dev/null +++ b/txt/3sqd84.txt @@ -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 `, where 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. diff --git a/txt/h1a9tg.txt b/txt/h1a9tg.txt new file mode 100644 index 0000000..25eaf12 --- /dev/null +++ b/txt/h1a9tg.txt @@ -0,0 +1,16 @@ +ID: h1a9tg +Date: 2022-11-20T13:28:57Z +Authors: orbifx +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) +- Identifier (URI) +- Name (URN) + + +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. diff --git a/txt/hvhhwf.txt b/txt/hvhhwf.txt new file mode 100644 index 0000000..3e66507 --- /dev/null +++ b/txt/hvhhwf.txt @@ -0,0 +1,52 @@ +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 ""` where is the initial title you wish the text to have. 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, `txt new -i ""` to have the text editor launched to edit the newly created file. + +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 ` where 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 ` will add the text file with 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 ` will copy the text file, revise the `index.pck` and also convert produce converted files, such .htm for public_html. + +## txt.conf keys + +Id: unique string for the repository to published +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 tag +HTM-footer: path to a file, inserted in every .htm file, right before the 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 diff --git a/txt/main.css b/txt/main.css new file mode 100644 index 0000000..b1ccb62 --- /dev/null +++ b/txt/main.css @@ -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}