Tabbed Plaintext v1 specifications
A valid TTXTv1 document has the following structure:[ HEADER ] [ BODY ] [ FOOTER ]
While
HEADER
and FOOTER
are entirely optional, the actual contents of the three parts are predefined.The optional
HEADER
part contains the Tabbed Plaintext specs version as TTXT VERSION 1
which might be important for later versions of this file format.The
BODY
is the actual document and the only required part of a valid TTXTv1 file. It consists of one or more chunks of text, each starting with a certain, user-defined string that defaults to "-------------" (13x "-") and is surrounded by the particular OS's default newline characters. The default string "-------------" may vary, depending on the implementation, but I'd recommend sticking with a common value.It is possible to set individual titles for each chunk of text. These begin with "Title: " and are to be placed directly under the chunk's initial separators. If and how display of these titles depends on the implementation, they are entirely optional, too.
A Tabbed Plaintext editor should display one tab per chunk without displaying the separator strings.
The
FOOTER
part is optional, too, and contains TTXT PRAGMA
directions which are, basically, file-specific meta tags, so it should be processed before processing the BODY
. The FOOTER
begins with newline - separator - newline
just like the text chunks and may only contain directions starting with TTXT PRAGMA
:TTXT PRAGMA SEPARATOR=xxx
: Sets the chunk separator for this file to "xxx".TTXT PRAGMA TITLES=[num | first <num> | custom]
: In theory, TTXTv1 supports various types of chunk titles (see the BODY
notes). By default, it assumes the "custom" setting which means that an editor with title display support should display every tabbed chunk as "chunk 1", "chunk 2" and so on unless there is a "Title:" setting for the particular chunk which has to be respected. A weaker version is the "num" setting which only enumerates the chunk tabs. A tiny alternative is the "first <num>" setting: If the document contains a TTXT PRAGMA TITLES=first 3
setting, each tab is displayed with the first 3 characters of the contained text chunk as its title.A complete example for a valid TTXTv1 document:
TTXT VERSION 1 ------------- Title: Lorem ipsum Lorem ipsum is some blind text. Blind means: It can't see! ------------- That's a rather hard fate, isn't it? ------------- Title: Page 3 Now we are on page 3. It all ends without any PRAGMA setting!Another valid example:
********** Simple page 1. ********** Simple page 2. ************ This will still be page 2 because the separator does not match the PRAGMA setting. ********** TTXT PRAGMA SEPARATOR=**********A ttxt capable text editor should be able to recognize a TTXTv1 document according to the contained meta tags (starting with TTXT) or, if possible, the .ttxt file extension.