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

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

Txt guides

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
7# New
8
9To 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.
10
11Alternatively add the -i flag, `txt new -i "<My title>"` to have the text editor launched to edit the newly created file.
12
13Text files will be stored in either:
141. The directory pointed at by txtdir if defined
152. $HOME/.local/share/texts, if directory exists
163. The current working directory, if all else fails
17
18The simplest approach is to put all texts in the local-share directory and override that on occasion with
19`txtdir`. For example:
20txtdir=. txt new "Hello world"
21
22
23# Publish
24
25Texts 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:
261. The current working directory
272. $HOME/.config/txt/txt.conf
28
29With 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.
30
31Logarion 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.
32
33## txt.conf keys
34
35Id: unique string for the repository to published
36Title: a human-friendly title
37Authors: comma seperated list of names and, optionally, addresses
38Topics: topics the repository aims to cover
39Locations: list of URIs the repositories can be accessed
40Peers: list of peer URIs
41Pubdir: (optional) the directory that contains publication subdirectories
42
43
44## HTML
45
46There are some special settings for HTML publication:
47
48HTM-style: path to a CSS style. It will be inserted in every .htm file. To link to a single CSS consider using `@import`
49HTM-header: path to a file, inserted in every .htm file, right after the <body> tag
50HTM-footer: path to a file, inserted in every .htm file, right before the </body> tag
51HTM-index: if defined, determines the filename for the index files. Left undefined, defaults to `index.html`
52HTM-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.