image

Use simple wiki-style templates to build better web sites. Example:

TML is a time machine from the future. If we write something in any of our pages about how simple it is and then later on create a page called simple.tml it will go back in time and create links pointing to it in all the pages we created!

Getting started

TML is free software. download tml

TML is extremely light-weight, lightening-fast, and cross-platform, thanks to the raw power of C and the flex lexical analyzer under the hood; however, C programs must first be compiled. Luckily, we have included an executable, tml.exe, so Windows users may opt to skip this section. For other operating systems:

  1. install a compiler for Linux variants or Windows,
  2. download and install flex,
  3. download tml and unpack it,
  4. edit the Makefile,
  5. run "make," and then "make install."
Close Windows, Open Doors

For users

TML runs in a cmd window. Simply add tml top your path.

  1. unpack the archive to someplace like c:\tml
  2. open a cmd window
  3. change to the tml directory: cd \tml

Convert README.txt to tml.html:

tml README.txt > tml.html

Instead of README.txt we could create "something.tml" with a text editor, and then use tml to turn that into a valid HTML web page.

tml something.tml > something.html

For programmers

TML may be run stand-alone, in makefiles, or configured as a compiler for text editors and integrated development environments (IDEs).

Set TML as compiler (CTRL-F7) for .tml files.

For the SciTE text editor, in User Options file, SciTEUser.properties, add the following:
    command.compile.*.tml=tml -q "$(FileNameExt)" > "$(FileName).html"

Some Programmers prefer SciTE for its user-contributed scripts.

See the Makefile in this project for an example that uses tml with GNU make that we use to automatically (re)build all the html files even when they have names with spaces in them.

web building

For administrators

This bash script updates all pages and links across a domain.

for x in  *.tml; do tml -q "$x" > "${x%%tml}html"; done

If we later created a web page named "latest stylesheets.html" in the current directory to showcase all the stylesheets we made, we could run this script again to rebuild every .html file and replace every occurrence of the words, "latest stylesheets" with links to "latest stylesheets.html!" No more dead links. Delete "latest stylesheets.html" and all references to it are gone!

Header Section

Now we are ready to create our first tml file. The top of every tml page is a header section with a page title, description, stylesheets, and scripts.

As always, HTML tags may be freely mixed in wherever desired.

Title and icon

A title and/or icon may be added to the top of the page for search engines:

title: Page Title
icon: images/tml.icon

Description and keywords

A meta author, description, or keywords may appear at the top of the page.

description: TML is A useful utility for making HTML files and web sites.
keywords: HTML text editing programming web www html css w3c html5

Stylesheets and JavaScript

Stylesheets and scripts may be linked at the top of the page.

style: some_file.cssscript: some_script.js

The first linked stylesheet becomes the "preferred" stylesheet. Subsequent stylesheets are assigned rel="alternate1", rel="alternate2", etc. This is useful for using JavaScript to switch stylesheets dynamically.

Body Section

The header and body sections are separated by at least three dashes ---.

--- doubles as a horizontal rule. HTML tags may also be used (<hr>).


Links

URLs such as http://anch.org are linked automatically.

Change the link text: [http://anch.org click me] becomes click me.

Images

Images are the same as links, but instead of a text description we have the location of an image.

[http://www.w3schools.com/css/css_float.asp style="float:right;" images/web-design2.jpg] image

CSS rollover buttons

CSS rollover buttons are an extension to the usual wiki markup. They're just URL links that that let designers include extra class, style, and events. You could just as easily use HTML tags for this. The button styless should be defined in whatever css file the author links in the page header section. See dark.css for our example that defaults to a width of 100% of the container. You can make your own css rollover buttons or use an automatic button generator.

[[ button text ]] class="myButton inline" http://anch.org

becomes

button text

CSS image buttons

See dark.css for our example of an image button that extends the myButton class with an image. You can make your own image buttons like the ones in our images directory. The size isn't too critical. The image background stretches to fit and the button stretches the full width of the screen or navbar unless we use the inline class we defined in CSS.

[[ button text ]] class="myButton imaged inline" http://anch.org

becomes

button text

Headings

=Heading 1=
==Heading 2==
===Heading 3===

Bold, Italics, Strike

_*bold* in italics ~~strike^super^,,sub,,~~_ becomes bold in italics strikesupersub

Blockquotes

Each [tab] or [4 spaces] turns into a <blockquote>.
Indent more as desired.

An ordered list

An ordered list begins with "#" and is indented throughout.

    # First item
    # next item
        # indented more
  1. First item
  2. next item
    1. indented more

Unordered lists

An unordered list begins with "*".

    * First item
    * next item
        # ordered list indented more
        # item two
    * more items...

Tables

Creating tables is easy. This:

Name    ||Address   ||City
Joe     ||123 Main  ||Anywhere

Becomes:

Name Address City
Joe 123 Main Anywhere

Include HTML

Raw HTML files such as scripts, widgets, videos, and ad banners may be included anywhere on the page to make templates. Templates are desirable for readability and for keeping reusable content in a central location.

.include my_ad_banner.html

Files of type .tml will be converted to HTML first. Anthing else is included "as is."

Web design considerations

This web page, generated by TML, employs a custom table-less web design we created. Any css template may be used on your sites. See the CSS Zen Garden for ideas!

We used our own unique preferences for the generated HTML, with the tags over to the right for readability. View source of this page to see what we mean. Those who prefer their HTML tags on the left or indented in a more conventional way (such as students who have to conform) may wish to pipe the output through htmltidy prior to submission.

Project contributors

Programming and web design:

Henry Kroll http://thenerdshow.com

Contributed patches and updates are welcome. TML is very concise, but this leaves lots of room for bugs. You are free to fix and adapt it to your use under the terms of the GPL. There is no mailing list. Send corrections or patches to the author at nospam@thenerdshow.com.

TML and associated documentation are Copyright © 2013 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" TML is a small, independent non-commercial project not affiliated with large, commercial enterprises.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

contact
help
usage syntax download web design contributors
software
freespeech js editor anchor fsf.org
variants
tml for c tml for word
styles
evening club mix circuits daylight
image