TML Version 2.5

An easier way to make web pages!

TML specializes in turning text into XHTML 1.0 web sites. If you want a more general tool to convert text into a variety of document types, check out txt2tags. The output of TML differs significantly from txt2tags in that it, too, is easy for humans to read. TML stands for Text Markup Language or "Tagless" Markup Language. It simplifies webpage design by making HTML optional. Another difference when compared with txt2tags txt2html is that HTML tags may be freely mixed within TML when desired, or left out. TML will guess where to put most missing tags.

Similar to the way CSS aims to separate presentation from layout, TML aims to separate content from layout.

The source code for this page looks like text because it is!


Source code for this page

Usage

 tml README.txt
 tml README.txt > tml.html

Specifications

Our "proof of concept" TML to HTML converter aims to adhere to these specifications. Eventually we plan to have server and client versions as well.

A customizable CSS file, tml.css is the default stylesheet. It defines the colors and styles of objects on the page. To define a different stylesheet, put

.css somefile.css at the top of the page.

The first line at the top of the page becomes the default page title. To define a different page title than the one that shows up on the page, put .title My Title at the top of the page.

Lines without punctuation are automatically made into large headings. Put a number of = signs before a heading to make it smaller. Blocks of text are considered to be paragraphs and are enclosed in <p> </p> tags.

This paragraph contains a link to the author's web site. Our TML parser recognizes the "http://" followed by (description or image) and turns it into a clickable link. URLs without descriptions, like anch.org, are also made into links. Relative links are not really supported, but again, just use <a href tags when desired.

A blockquote begins with a tab or 4 spaces. Such paragraphs are considered to be blockquotes and are surrounded by the appropriate tags.

An ordered list

Ordered lists begin with a #.

  1. First item
  2. next item
  3. last item

An unordered list begins with a *.


Tables

Creating a table is as simple as typing columns of text. Here is a table describing some of the basic HTML conventions and how to achieve them using TML.

TO CREATE TML HTML
links http://site.com (description) <a href="http://site.com">description</a>
horizontal rule 3 or more hyphen (-) characters <hr>
images http://site.com (image.gif) <a href="http://site.com"><img src="...
tables columns of text <table><tr><td>...
div .div name, content, 5 dots ..... <div id="name">content</div>
button .[ label ] http://site.com <div class="button"><a href...

This web page uses the new table-less web design. The navigation bar at left is achieved with a CSS-positioned <div> element named "navbar". The navbar features rollover buttons and an image.

Contributing

Contributed patches and updates are welcome. TML is written using the flex lexical analyzer, which makes it a concise 350 lines of easily readable code. You are free to adapt it to your use under the terms of the GPL. There is no mailing list yet. Please send patches to the author using the contact link.

TML and associated documentation are Copyright © 2011 Henry Kroll III. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".