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