YAM minimal test file.
1. YAM Syntax
1.1. Bold, italic 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.
1.2. Horizontal lines
Horizontal lines are indicated by 2 or more % signs at the start of a line. For example:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%both result in:
Unordered lists are indicated by 'o' at the start of a line, and ordered lists by '-'. Nesting is indicated by two spaces preceding the item indicator. For example:
- This is an undordered list - Second item o This is a nested... o ...ordered list - Back to the third item of the enclosing listresults in:
- This is an undordered list
- This is a nested...
- ...ordered list
- Back to the third item of the enclosing list
1.4. Verbatim output
Verbatim output starts with '<<' at the start of a line and ends with '>>'. For example:
<< This *will not* get translated >>
When the target language is HTML, for example, the output will contain
'<pre>' tags. It is also possible to tell the translator to write
output directly without any intervention, using '%output':
%output( This will not get translated either, but any markup in the target language will be interpreted in that language. )
Notes are like this:
%notes("This is a note")
The contents will be output to the translation file, but will be commented out in that file. The quotation marks around the note are necessary; notes cannot contain quotation marks (even if escaped).
To stop a special character from being interpreted, use a '\'. For example,
\%%will not generate a line.
Some syntax elements interact with each other and produce unexpected escaping behaviour. For example, in
'=http://gate.ac.uk/='the equals signs are translated, but not the URL they contain (with the result 'http://gate.ac.uk/').
Headings are lines starting with %1 (for first level), %2, %3 or %4. For example, the heading for this section is
1.8. Links and anchors
Links can be specified in four 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
Using Wiki syntax
NOT DONE YET
Anchors and labels are specified using '#name'. For example,
%2 A Heading #labelwill result in a heading followed by the anchor label.
Quotations are enclosed in '"' marks that start are preceded by two spaces at the start of a line. For example,
"This is a quote"becomes:
This is a quote
1.10. Line breaks
Line breaks are indicated by a backslash at the end of a line. For example:
This line is broken\ in two.becomes:
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 %]results in:
|header col 1||header col 2|
|row 1 col 1||col 2|
|row 2 col 1||col 2|