source: code/trunk/doc/hvhhwf.txt@ 72

Last change on this file since 72 was 65, checked in by Izuru Yakumo, 8 months ago

Replace Cmdliner with Ocmd, re-add documentation

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

File size: 2.9 KB
Line 
1ID: hvhhwf
2Date: 2022-11-06T13:19:57Z
3Title: Creating texts & publishing on the net
4Authors: orbifx
5Topics: Logarion
6
7# New
8
9To create new text files, use "txt new". For example:
10 txt new "Hello world"
11It'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.
12
13Alternatively add the -i flag to have the text editor launched to edit the newly created file:
14 txt new -i "Some title"
15
16Text files will be stored in either:
171. The directory pointed at by txtdir if defined
182. $HOME/.local/share/texts, if directory exists
193. The current working directory, if all else fails
20
21The simplest approach is to put all texts in the local-share directory and override that on occasion with
22$txtdir. For example:
23 txtdir=. txt new "Hello world"
24
25
26# Publish
27
28Texts 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:
291. The current working directory
302. $HOME/.config/txt/txt.conf
31
32With 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.
33
34Logarion 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.
35
36## txt.conf keys
37
38Id:
39 A random, unique, alphanumeric string for distinguishing the repository (atleast 6 characters of Crockford's Base32 recommended)
40
41Title:
42 a human-friendly title
43
44Authors:
45 comma seperated list of names and, optionally, addresses
46
47Topics:
48 topics the repository aims to cover
49
50Locations:
51 list of URIs the repositories can be accessed
52
53Peers:
54 list of peer URIs
55
56Pubdir:
57 (optional) the directory that contains publication subdirectories
58
59
60## HTML
61
62There are some special settings for HTML publication:
63
64HTM-style:
65 path to a CSS style. It will be inserted in every .htm file. To link to a single CSS consider using `@import`
66
67HTM-header:
68 path to a file, inserted in every .htm file, right after the body tag
69
70HTM-footer:
71 path to a file, inserted in every .htm file, right before the body tag
72
73HTM-index:
74 if defined, determines the filename for the index files. Left undefined, defaults to `index.html`
75
76HTM-feed:
77 if defined, this will overrite the feed URI used in HTML files. If left undefined the default `feed.atom` is used
Note: See TracBrowser for help on using the repository browser.