source: code/trunk/txt/hvhhwf.txt@ 38

Last change on this file since 38 was 35, checked in by fox, 2 years ago

Improve txt.conf:ID documentation

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