| 1 | |
| 2 | == Creating texts and publishing |
| 3 | |
| 4 | === New |
| 5 | To create new text files, use {{{ txt new }}}.\\ |
| 6 | For example:\\ |
| 7 | {{{ |
| 8 | $ txt new "お会いできてうれしいです" |
| 9 | }}} |
| 10 | |
| 11 | It's important to enclose the title with quotation marks if it contains spaces (or just for clarity).\\ |
| 12 | The command will return the filename of the new text, which contains its ID.\\ |
| 13 | Use your favourite text editor to open it. |
| 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 {{{ $HOME/.local/share/texts }} directory and override that on occasion with {{{ $TXTDIR }}}.\\ |
| 21 | For example:\\ |
| 22 | {{{ |
| 23 | $ env TXTDIR=${PWD} txt new "お会いできてうれしいです" |
| 24 | }}} |
| 25 | |
| 26 | === txt.conf |
| 27 | |
| 28 | * Id: A random, unique, alphanumeric string for distinguishing the repository (at least 6 characters of Crockford's [https://en.wikipedia.org/wiki/Base32 Base32] recommended) |
| 29 | * Title: A human-friendly title |
| 30 | * Authors: Comma-separated list of names (and optionally, addresses in the {{{ <name@domain> }}} format |
| 31 | * Topics: Topics the repository aims to cover (comma-separated) |
| 32 | * Locations: List of [https://en.wikipedia.org/wiki/URI URIs] where the repository can be accessed |
| 33 | * Peers: List of peer !URIs |
| 34 | |
| 35 | === HTML |
| 36 | There are some special settings for HTML publication: |
| 37 | |
| 38 | * HTM-style: path to a CSS style. It will be inserted in every .htm file. To link to a single CSS consider using `@import` |
| 39 | * HTM-header: path to a file, inserted in every .htm file, right after the `<body>` tag |
| 40 | * HTM-footer: path to a file, inserted in every .htm file, right before the `</body>` tag |
| 41 | * HTM-index: if defined, determines the filename for the index files. Left undefined, defaults to `index.html` |
| 42 | * HTM-feed: if defined, this will overrite the feed URI used in HTML files. If left undefined the default `feed.atom` is used |
| 43 | |
| 44 | === Gemtext |
| 45 | Likewise, there are settings for publishing on the Gemini protocol: |
| 46 | |
| 47 | * Gemini-index: same as `HTM-index` |
| 48 | * Gemini-feed: same as `HTM-feed`, except `gmi.atom` is used |