Example txt2html Document

This document illustrates simple examples of all the formatting and mark-up that the txt2html tool recognizes. This example.html file was created from the text file example.txt by typing:

txt2html example.txt > example.html


Mark-up Syntax:

This is an example of bold text. This is an example of italicized text. This text is both bold and italicized.

This is a link to another location in this document.

This is a link to another document, the README.html in this same directory.

This is a link to another location in the README.html document.

This is a link to the Google WWW site.

If you look in example.txt you will see that the first 2 links were created in-line, while the last 2 used an alias to a definition elsewhere in the example.txt file.


Paragraph Styles:

This is a default paragraph with no formatting styles appended.

This paragraph has a :p command appended. It should look the same as the default.

This paragraph has a :b command appended. It should have no following newline.
This paragraph has a :c command appended. It should be centered.

This paragraph has a :h3 command appended.

This paragraph has a :c,h3 command appended. It will also be centered

This paragraph has a :pre appended.
It will appear with a different font and
  with spacing exactly as in the example.txt file. 

Lists:

This is a bulleted list, created with a single :ul appended to the last line of the list:

This is a numbered list; an :ol command is appended:

  1. item 1
  2. item 2
  3. item 3

And this is a definition list, using a :dl command:

item 1
This is a description of the first item.
item 2
The text file doesn't need any indentation so long as each of the 6 entries in the list is a single line in the example.txt file; the list format creates the indentation. This entry in the example.txt file illustrates the use of the "\" character at the end of lines, to create one long line.
item 3
This is a description of the third.

An item in a list can have multiple lines and paragraphs if the formatting commands are applied to each line of the list:


Commands applied to each line in the paragraph:

This entire paragraph is centered
line by line
by appending :all(c) to the
last line.
This entire paragraph consists of short lines
that are left-justified.
This is done by appending :all(b) to the
last line.

This is a simple bulleted list with no indentation, by appending :all(l) to the last line.

  • item 1
  • item 2
  • item 3

    Special commands:

    This leading and trailing horizontal breaks for this section were created using the :line command.

    The :c,image(file) command inserts this image of an equation. The "c" causes it to be centered.

    The :image(file,link) command inserts it again, and allows you to click on it to go to the Google WWW site.

    The :link(name) and :link(alias,value) commands were illustrated earlier in this document.


    Table command:

    This is a simple default table created by appending :tb to the last line.

    Procs 1 2 4
    CPU 10.0 5.1 2.8

    The next table used :tb(b=5,s=;,a=r) to create a larger border, use a different delimiter character in the example.txt file, and align to the right of the browser window.

    Procs 1 2 4
    CPU 10.0 5.1 2.8

    The next table with :tb(w=100%,ea=c) has a width percentage that fills 100% of the screen and the text in each entry aligned to the center.

    Procs 1 2 4
    CPU 10.0 5.1 2.8

    The next table with :tb(cw1=5x0%,w=20,ca1=r) has the width of column 1 = 50%, the rest of the columns of width 20 pixels, and the data in column 1 aligned to the right.

    Procs 1 2 4
    CPU 10.0 5.1 2.8

    The next table with :tb(c=3,cva1=t,eva=bo,cw2=60) has three columns. Column one is vertically aligned to the top, there is a break row specified by just commas, the data is vertically aligned to the bottom, and the width of column 2 is 60 pixels.

    Section OneLine One Line Two Line ThreeColumn three
    Section Two (bold) Line One Line Two Line Three Column 3

    The next table with :tb(c=3,cva1=t,b=0,w=60%,cw3=80%,s=***) has three columns (only two that have information - see heading two). Column one is vertically aligned to the top, there is no border, the width of column 3 is 80% of the table, the width of the table is 60% of the screen, and the separator is not a comma (it is ***).

    Heading One A couple of sentences that wrap. For example, a definition, an explanation, a point about this particular page, and so forth. The lines wrap, no matter where you insert newlines, if you specify a specific number of columns. Don't forget to include spaces, or your words will also wrap together.
    Heading Two There is a bit of a break between the last paragraph and heading twobecause we inserted a row of blank space. There is a separator columnbetween the heading and the paragraphs because we included an extraseparator there (compare with distance between columns in tableabove). To make the distance larger, put <br> in the extracell. It need not be included in every row, just one.

    The next table with :tb(c=3,b=0,w=60%,cw2=5%,s=***) has columns equals three, there is no border, the width of the entire table covers 60% of the screen, column two has a width of 5% of the table, and the separator is, again, ***.

    Heading One Heading Two
    This table is similar to the last one. A couple of sentences thatwrap. For example, a definition, an explaination, a point about thisparticular page, and so forth. The lines wrap, no matter where youinsert newlines, if you specify a specific number of columns. Don'tforget to include spaces, or your words will also wrap together. This table has no extra row like the one above, but it does havethe extra column to separate the data columns. This column is 5% ofthe total width, so it is big enough to make a clear break between thecolumns, but not overwhelming. More text to wrap. More text to wrap.More text to wrap. More text to wrap. More text to wrap. More textto wrap.