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