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

Last change on this file since 42 was 39, checked in by fox, 2 years ago

Read References field; referred by listing; test & tidy documentation

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