Log in Help
Print
Homegatewikicowtestunitgateyamresources 〉 yam-minimal.html
 

YAM minimal test file.

Contents

1. YAM Syntax

1.1. Changes from version 3

Slides: maybe:

1.2. Contents

Contents listings like that above are generated by '%contents'

1.3. Bold, italic, underline and teletype

Bold text is contained in stars: *this is bold* becomes this is bold.

Italic text is contained in underscores: _this is italic_ becomes this is italic.

Fixed-width text is contained in equals signs: ^this is teletype^ becomes this is teletype.

Underlined text is contained in doubles undercores: __this is underlined__ becomes this is underlined.

1.4. Horizontal lines

Horizontal lines are indicated by 3 or more - signs at the start of a line. For example:

---

and

---------------------------

both result in:


1.5. Lists

Unordered lists are indicated by '-' at the start of a line, and ordered lists by 'o'. Nesting is indicated by increased spacing preceding the item indicator. For example:

- This is an undordered list
- Second item
  # This is a nested...
  # ...ordered list
- Back to the third item of the enclosing list

results in:

Lists end when there is a blank line or where the next line of text is not indented. For example:

- This is a one item list
followed by
- another one item list.

results in:

followed by

1.6. Verbatim output

Verbatim output starts with '%<' and ends with '%>'. For example:

%< This will *not* get translated. %>

When the target language is HTML, for example, the output will contain '<pre>' tags.

1.7. Footnotes

Footnotes are like this:

%footnote(This is a footnote.)

Becomes:1.

The contents will be put in a section at the end of the document (HTML) or at the bottom of the page (LaTeX), and linked by number from where they occured.

1.8. Escapes

To stop a special character from being interpreted, use a '\'. For example,

 \--- 

will not generate a line.

1.9. Headings

Headings are lines starting with %1 (for first level), %2, %3 or %4. For example, the heading for this section is

%2 Headings

If a heading level is followed by "*" it is not numbered, e.g.:

%2* An unnumbered heading

Becomes:

An unnumbered heading

This heading will not appear in the contents table.

1.10. Links and anchors

Links can be specified in three ways:

  1. As plain text, e.g. 'http://gate.ac.uk/' will become http://gate.ac.uk/
  2. Using '%(target)', e.g. %(http://gate.ac.uk/) will become http://gate.ac.uk/
  3. Using '%(target, label)', e.g. %(http://gate.ac.uk/, GATE home) will become GATE home

Spaces or commas inside URLs must be escaped. A URL that appears in plain text must be followed by a space, tab or newline.

Anchors and labels are specified using '%#name'. For example,

%2 A Heading %#label

will result in a heading followed by the anchor label.

Spaces or commas inside anchors must be escaped. An anchor that appears in plain text must be followed by a space, tab or newline.

A relative link to a non-existant file will be rendered as a link to the host application's "create" page, e.g.

 %(../non-existant.html) 

becomes:
../non-existant.html

A link to an existing file will be just link as normal, e.g.

 %(yam-lists.html) 

becomes:
yam-lists.html

1.11. Block quotations

Block quotations are enclosed in %" marks. For example,

  %"This is a quote%"

becomes:

This is a quote

Note that because the quote marks are treated as normal words, they can cause overlap problems (in the same way that an unclosed bold or italic mark might). For example,

%"
- list
%"

is not a good idea as the end of the quote will preceed the end of the list. The workaround is to close the list first by adding a blank line:

%"
- list

%"

which then results in something sensible:

1.12. Line breaks

Line breaks are indicated by %br at the end of a line. For example:

This line is broken %br in two.

becomes:
This line is broken
in two.

1.13. Tables

Tables use square brackets, bars and dashes. For example:

%[
 | *header col 1*	| *header col 2*        |
 ---
 | row 1 col 1	        | col 2                 |              
 ---
 | row 2 col 1	        | col 2                 |
%]

results in:

header col 1 header col 2
row 1 col 1 col 2
row 2 col 1 col 2

1.14. Images

Images are like URLs:

You can also specify an ALT tag, width and height, position and border width: '%image(test-image.png, ALT tag, 500, 500, left, 0)' becomes ALT tag

1.15. Citations

Citations work like this: '%cite(Cun06a)' becomes Cun06a. Multiple cite keys should be separated by commas, e.g.: '%cite(Cun05a,Cun06a)' becomes Cun05a, Cun06a.

1.16. Inclusion

A page can include another page like this:

%include(yam-first.yam)

Becomes:

This, by way of contrast, is a paragraph.

This is another paragraph. It contains two lines.

Note that headings in the included files are ignored by default.

An increment to be added to the heading level can be given as the first argument.

A "useTitle" flag can be given (after the increment if it exists) to cause inclusion of the title (as a heading).

1.17. Non-breaking space

Non-breaking spaces are added using %\ followed by space, e.g.

This line %\ %\ %\ %\ has spaces in the middle.

This line     has spaces in the middle.

1.18. Comments

Single-line comments are created by two or more percents together, e.g.

This is not commented   %% but this is

becomes:
This is not commented

Multi-line comments are created by %/* and %*/, e.g.

This is not commented   %/* but this is
and this is too %*/

becomes:
This is not commented

Footnotes

  1. This is a footnote.