About ANTLR |
Latest version is 2.7.7.
Download now! »
Terence's Markup Language
Version 0.1, March 24, 2004
[This doc is inadequate at best, but with the source and some samples, you can figure it out. ;)]
I do all of my course materials in TML; it's just fabulous for generating HTML, though I've given up using TML for anything but HTML. I use LaTeX for papers. Anyway, any *.tml file in these directories should give the idea.
Introduction and Motivation
Humans brains gravitate towards WYSIWYG editors because the formatted text is just the text with a visual layout and possibly some font twiddling like bold and italics. In constrast, reading the computer representation of this (HTML, RTF<shudder>, PostScript) can be difficult. Your brain has to filter out the formatting instructions to get at the text.
The problems with WYSIWYG editors in my view are:
The alternative of choice for technical folks is to use a text-based formatting system like LaTeX or nroff or even HTML. Again, though, you are providing formatting information not high-level document components. DOCBOOK on the other hand has the high-level nature you want, but it adds so much markup that I find it very hard to read the text I'm writing.
My solution to this problem is take the best of WYSIWYG and text-based systems and merge them into a system that covers 90% of my document needs. This system, TML (Terence's Markup Language), is a Wiki-inspired document language that I've used successful to produce course materials, web pages, and slides.
Consider writing a piece of email. You specify your formatting visually with newlines and simple markup like *bold this* and so on. The idea in TML is to use the visual information as markup for paragraphs and sections rather than explicit tags. This allows you to read your document naturally in a text editor. A translator on the back end can generate Lout, DOCBOOK, HTML, or whatever you want.
This document describes the basic syntax of TML and, because it is written in itself, this document provides a simple example.
The first line of any document is the title. Sections are denoted with multiple # characters where #### indicates the outermost section. In other words, the bigger the visual display the more major the section. All paragraphs start with a blank line. Here is a simple TML document:
Bullet lists are just like you do in email text:
To make numbered lists use
For formatting words, you can use the following
Tables are done sort of visually:
Links. Use style @(http://www.antlr.org) and @(http://www.antlr.org, ANTLR).
Plugins. %foo(...) invokes org.tml.plugin.foo.translate(...), sending the result to the output file.
to include a file or
to have it appear in <pre> tags.
to send something straight to output.
Can put a box around something:
To run TML on your TML files, just run stdin to org.antlr.tml.Tool. Here is the shell script I use to run tml via $ tml foo (takes foo.tml and makes foo.html):
Note that you must have ANTLR in your CLASSPATH to build and run TML.