YAM minimal test file.
- 1. YAM Syntax
- 1.1. Changes from version 3
- 1.2. Contents
- 1.3. Bold, italic, underline and teletype
- 1.4. Horizontal lines
- 1.5. Lists
- 1.6. Verbatim output
- 1.7. Footnotes
- 1.8. Escapes
- 1.9. Headings
- 1.10. Links and anchors
- 1.11. Block quotations
- 1.12. Line breaks
- 1.13. Tables
- 1.14. Images
- 1.15. Citations
- 1.16. Inclusion
- 1.17. Non-breaking space
- 1.18. Comments
1. YAM Syntax
1.1. Changes from version 3
- horizontal lines are now three or more dashes
- comment syntax: %% for single lines, and %/* ... %*/ for multiple lines
- addition of column separator bars at the start and end of table rows
- multiple lines allowed in titles
- added underlining
- no more %output function
- changed quotation syntax to %"
- changed line break style to %br
- output is correct XHTML
- verbatim output is %< ... %>
- target language control characters (like < or &) now dealt with properly
- headings can be unnumbered, e.g. "%2*"
- numbered lists are now prefixed by "#" instead of "o"
- added non-breaking spaces
- if the document contains %slides then treat it all as slides
- else if it contains %slide...%endslide then treat each of those as slides
Contents listings like that above are generated by '%contents'
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.
Horizontal lines are indicated by 3 or more - signs at the start of a line. For example:
both result in:
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
- This is an undordered list
- Second item
- This is a nested...
- ...ordered list
- Back to the third item of the enclosing list
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.
- This is a one item list
- another one item list.
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.
Footnotes are like this:
%footnote(This is a footnote.)
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.
To stop a special character from being interpreted, use a '\'. For example,
will not generate a line.
Headings are lines starting with %1 (for first level), %2, %3 or %4. For example, the heading for this section is
If a heading level is followed by "*" it is not numbered, e.g.:
%2* An unnumbered heading
An unnumbered heading
This heading will not appear in the contents table.
Links can be specified in three ways:
- As plain text, e.g. 'http://gate.ac.uk/' will become http://gate.ac.uk/
- Using '%(target)', e.g. %(http://gate.ac.uk/) will become http://gate.ac.uk/
- 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.
A link to an existing file will be just link as normal, e.g.
Block quotations are enclosed in %" marks. For example,
%"This is a quote%"
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:
Line breaks are indicated by %br at the end of a line. For example:
This line is broken %br in two.
This line is broken
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 | %]
|header col 1||header col 2|
|row 1 col 1||col 2|
|row 2 col 1||col 2|
Images are like URLs:
- '%image(test-image.png)' will become
- '%image(test-image.png, a test image)' will become (the text becomes the "alt" attribute of the image)
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
A page can include another page like this:
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).
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.
Single-line comments are created by two or more percents together, e.g.
This is not commented %% but this is
This is not commented
Multi-line comments are created by %/* and %*/, e.g.
This is not commented %/* but this is and this is too %*/
This is not commented