// // Time-stamp: // 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 [[ezml.ezml]written using EZML] (although you are probably viewing it after conversion to HTML). $Document Preamble Lines up to the first blank line of an EZML document are part of the preamble of the document. - The first line is the title of the document. - The second line of the preamble is the author(s) of the document. - The third line of the preamble is the date 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. $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 $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. $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 the block| |++|Format as program code| |++|Format as footnote| |++|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 ++ block, and a line containing only +\[+ is the same as starting a ++ 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:
This text is centered.
This text is centered.
public void main(String[] argv) { // Something here if (argv.length > 0) { ... } } public void main(String[] argv) { // Something here if (argv.length > 0) { ... } } This is a footnote. This is a footnote. This is a quotation. This is a quotation. $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 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 # Item 1 of ordered list # Item 2 of ordered list # 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: - 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 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 - Item 1 - Item 2 ## Item 2.1 ## Item 2.2 - Item 3 $Tables Tables are perhaps the most complicated part of EZML, although it's really pretty simple. - A table begins and ends at a line starting with +=+ (equals sign). - The caption of the table can follow the equals sign. - Then each row of the table is a line starting with +|+ (pipe). - The elements of the row are separated by +|+. - If a line ends with +|+, then it is the end of the row. Otherwise that element continues onto the next line. 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| = $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 [[file.html]the file] for you to read. Here it is without a label: \[[file.html]] Here it is without a label: [[file.html]] $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. $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).