EZML Reference Manual

George Ferguson

12 Oct 2004

EZML is a simple markup language for formatting documents which can then be translated into various other markup languages, such as HTML. It is designed to be very easy to learn and to use, and yet still provide the basics needed for good looking documents.

This manual is itself written using EZML (although you are probably viewing it after conversion to HTML).

1 Document Preamble

Lines up to the first blank line of an EZML document are part of the preamble of the document.

The preamble may contain fewer than three lines (followed by a blank line), in which case the author(s) and/or date may be unspecified.

2 Document Structure

Sections are defined by a line that starts with a $ (dollar sign). One dollar sign indicates a section, two dollar signs a subsection, three dollar signs a subsubsection, etc.

Paragraphs are separated by blank lines (except within code blocks; see below).

Examples:

$First Section

$$A subsection

$$$The subsubsection

3 Inline Formatting

Inline formatting changes the style of text within the flow of the document. The following style elements are defined:

Element Meaning Example Result
* Bold the *bold* word the bold word
_ Italic the _italic_ word the italic word
+ Code the +code or tt+ word the code or tt word
" Quotes the "quoted" word the quoted word

Different translators may translate other sequences as necessary for the target language. For example, for HTML, the characters <, >, and & must be converted, although these may appear freely in EZML.

4 Block Formatting

Block formatting results in text that is set off from its surroundings. The general pattern in EZML is that the sequence <style> at the start of a line indicates a block of the given style. The block should be ended with another similar line (the slash used to close entities in HTML/XML is optional in EZML).

The following block styles are defined:

Element Meaning
<center> Center the block
<code> Format as program code
<footnote> Format as footnote
<quotation> Format as block quotation
<other> User-defined block style
A user-defined style may or may not be translatable into a given target language. For HTML, this can usually be accommodated with stylesheet additions. For LaTeX, it might mean defining some new environments.

As a shorthand, a line containing only [+ is the same as starting a <code> block, and a line containing only [ is the same as starting a <quotation> block. Both of these should be closed with a line containing only ].

Note that footnotes may or may not end up as what you might think of as a footnote.

Blank lines do not cause paragraphs in a code block, but are just blank lines, however that gets rendered in the target language.

Examples:

 <center>
 This text is centered.
 <center>

This text is centered.

 <code>
 public void main(String[] argv) {
   // Something here
   if (argv.length > 0) {
     ...
   }
 }
 <code>

public void main(String[] argv) {
  // Something here
  if (argv.length > 0) {
    ...
  }
}

 <footnote>
 This is a footnote.
 <footnote>

This is a footnote.

 <quotation>
 This is a quotation.
 <quotation>

This is a quotation.

5 Lists

There is no need to start a list explicitly. List items are introduced simply by beginning a line with - (minus) for an unordered list and # (pound) for an ordered list. The list item continues until the next list item starts or until a blank line ends the list.

For a nested list, use multiple - or # characters to indicate the level of nesting.

Examples:

- Item 1 of unordered list
- Item 2 which as you see
continues on to the next line
- Item 3 is the last, followed by blank

# Item 1 of ordered list
# Item 2 of ordered list
# Item 3 of ordered list

  1. Item 1 of ordered list
  2. Item 2 of ordered list
  3. Item 3 of ordered list

Here is a an unordered list with some nested unordered lists:
- Item 1
- Item 2
-- Item 2.1
-- Item 2.2
- Item 3
- Item 4
-- Item 4.1
-- Item 4.2
-- Item 4.3

Here is a an unordered list with some nested unordered lists:

Here is a list with a nested ordered list
- Item 1
- Item 2
## Item 2.1
## Item 2.2
- Item 3

Here is a list with a nested ordered list

6 Tables

Tables are perhaps the most complicated part of EZML, although it's really pretty simple.

Example:

= Table of Examples
|Row 1, col 1|Row 1, col 2|Row 1, col 3|
|Row 2, col 1|Row 2, col 2, which is quite long and continues
on the next line|Row 2, col 3|
|Row 3, col 1|Row 3, col 2|Row 3, col 3|
=

Table of Examples
Row 1, col 1 Row 1, col 2 Row 1, col 3
Row 2, col 1 Row 2, col 2, which is quite long and continues on the next line Row 2, col 3
Row 3, col 1 Row 3, col 2 Row 3, col 3

7 Hyperlinks

A hyperlink is marked with two square brackets ([[). If it ends with two square brackets, then the label of the link (what you read) is the same as its referent (what it links to). Otherwise the first square bracket ends the referent and the label is the text between it and the second square bracket.

Examples:

Here is [[file.html]the file] for you to read.

Here is the file for you to read.

Here it is without a label: [[file.html]]

Here it is without a label: file.html

8 Comments

Lines starting with // (two slashes) are comments and are not translated into the target document. They also don't count towards the preamble, in case you were wondering.

9 Target Languages

Currently EZML can be converted into HTML. The HTML is designed to be easy to customize with a stylesheet (a default stylesheet is provided, and the output looks reasonable with no stylesheet).

XML and LaTeX would be easy to do.

Sections are automatically numbered in the current HTML output. It would be possible to do this with the stylesheet also, except that Safari does not support the necessary counter properties (as of this writing).