Standard Text Format

Formatter/Compiler Decompiler Reader


One day during the summer of 2016, I was at my internship looking up documentation when I stumbled upon something called the RFC 2119. Beyond the pure joy of discovering +7000 documents regarding various standards/ideas put forth by the IETF, I fell in love with the simple, elegant layout of their .txt files, so much so that I then began work on writing a script to format any text into a similar layout.

Thus, the "Standard Text Format" was formed, and along with the initial script, I wrote two more: one to undo the formatting done by the formatter (essential for modifying the txts after creation), and another to help read through/navigate txt files hundreds of pages long (it also lets you make bookmarks for quick reference). None of these scripts are perfect, and there may be bugs and inconsistencies across them, but for the most part, they work quite well, so I hope you enjoy making your txt files prettier.

Notes on the formatter:

The formatter works by splitting the text into paragraphs by line breaks. It doesn't matter if there is 1 line break or 15; the program will always ensure paragraphs are two line breaks apart.

Not everything will be formatted into paragraphs though. Aside from the header/code/date/author fields which are layed out automatically, it is possible to specify that a different layout should be used via various HTML tags. Currently, the following tags are supported:

h1 tags create new sections/titles within the document. They skip to the next page, and center the text at the top. Line breaks within an h1 tag cause the text to be on multiple lines.

blockquote tags cause the text inside to be indented more with a vertical line of pipe (|) characters separating the section from the rest of the text. Line breaks within a blockquote tag allow for multiple paragraphs within a blockquote.

The hr tag inserts a horizontal row into the text at that point

ol tags create an ordered list starting with 1, 2,... line breaks are used instead of li tags to differentiate items.

ol tags create an hyphen-bulleted list. Line breaks are used instead of li tags to differentiate items.

Any of the above tags can also be used with double bracket notation [[tag]] instead of pointy bracket <tag> notation as the tags are removed and replaced with the bracket notation before processing.