Español Català English Esperanto
This is the syntax used by the program dislines, http://www.danielclemente.com/dislines/index.en.html
@tag Rest_of_the_line
tag
can't have spaces, so the real lines start at the first space.
@en This line will only appear at file.en.ext @eo And this one, at file.eo.ext Lines without tag are common to all files.
The valid characters for a tag name
are: all which are allowed for a file name,
except these: @ ,{}/\
To assign two or more tags to a line, separate them with commas:
@it,es,fr 50 euros @en $60
Note: don't put spaces between commas. Remember that the real line starts from the first space.
If you're going to write several lines with the same tag, it's not necessary to repeat it at each line. You can use blocks:
@{en All these lines are only in the English version. @}en
Several tags can also be used:
@{es,en,it aaaa bbbb @}es,en,it
There are several ways to write the start and end tags for a block:
@{tag
@tag{
@}tag
@tag}
@}
The shortest and most comfortable is possibly:
@en{ aaaa bbbb @}
Blocks can't be nested.
Some techniques are allowed to make this language easier to use.
If you want to write several lines with the same tag,
blocks do work. But if there are few lines, you can
just repeat @tag
at each line, or also use
@
followed by one or more double quotes ("
)
to reuse the previous tag.
Ex.:
@en Tag 'en' @"" Same tag (en) @"" The same (en) @fr Tag 'fr' @"" The same (fr)
You can insert comments:
@-- This line will not appear in any version
The number of dashes (-
) can be anything. Example:
@--------------- also works
You can also use comment blocks:
@{--- several lines @}---
If you want to maintain the same margin on each line, there are several ways:
You can put more than one at (@
) at the beginning of a command:
@@@català |--- prova --| @@@@@@esp |-- prueba --| @@english |--- test ---| @@@@@@@eo |--- provo --| @very_long_tag_name 123456789 @@@@@@@@@@@@@@short 987654321
Common lines can also be written with several ats at the beginning, and they mean nothing special:
@en English line @es Línea en español @@@ This line is common
The comments (@--
) and the tag repetition (@""
)
can use any number of -
or "
.
It's not necessary that you know this except if you have ever found with one of these problems.
Common lines can be written directly, but if they start by @ they will be interpreted as a tag assignation.
The solution is to use the useless ats, explained at the previous section.
Ex.: to write @echo on
:
This isn't correct, it's assigning the tag "echo" @echo on The correct one is: @ @echo on @@@@@ @echo on @@@@@@@@@ @echo on etc.
This also applies to blocks: you must put @ @echo on
inside a block
so that it doesn't get interpreted as a tag assignation.
When using blocks, it's recommended to leave the opening and closing lines with no more text than the own tag. For instance:
@{es aaaaaaa bbbbbb ccccccc @}es
If you included text, for instance,
@{es aaa bbb ccc @}es ddd
then both the first (aaa
) and the last (ddd
) would be ignored.
The reason for not including aaa
is that we don`t want to be adding a blank line
if you opened a block just with @{es
.
The only commands accepted inside a block are the one-line
comments (@----
) and the useless ats at the start of the
line:
@{fr @---- comment; doesn't appear at 'fr' nor anywhere @---- it would be incorrect to write now: @en Hello All this is equivalent: a b c @ a b c @@@@@@ a b c @}fr
The rest of commands will give error.
Since blocks can't nest, the block comments (@{--
) don't
work to comment other blocks. You must use @--
at each line.
The reasons for interpreting lines inside a block are:
be consistent with that about "all lines which started by @ at
the original file have to be protected by an initial @",
allow comments inside a block, and allow to write @}
without closing it unwillingly.
@""
(repeat the last used tag) only works with simple tags,
not for blocks. Just enlarging it should work.
If you write @""
at the first line (there's no previous tag),
it's interpreted as if it were a common line.
This:
@{ aa bb @}
is useless and incorrect. The same with @{,
and others.
It isn't necessary to write this:
@---,aa,---,-,---,bb lalala
It's the same as @aa,bb lalala
(comments are ignored).
Same with blocks.
This isn't recommended and has an undefined result:
@en,en Double? Maybe yes, maybe not.
For version 2 of this specification (if it's necessary to do it), I may include things like:
They are written at the beginning of the file:
@! instruction
They would do a lot of things. For instance:
@! ExecuteAfter: txt2tags $BASENAME.en.t2t @! Encoding(es): iso-8859-1
@! Group euros es,fr,it
And then:
@euros 6 euros ( equal to @es,fr,it )
You can assign to a line "all tags except these ones". Ex.:
@ˆen Everything except en @ˆen,it Everything except en,it @ˆ{en everything except en .... .. @ˆ}en
This:
@{en,en ab cd @}en,en
should it repeat that block two times? It doesn't seem useful, and makes the program more complex.
Tell me what do you think about this language and program, and what can I add, remove or simplify. I want it to be simple, useful, and suitable for being written manually.
July 2005, Daniel Clemente Laboreo. ( n142857 {at/- g-m-a-i-l- .-c-o-m )