This document describes all the details about each txt2tags mark. The target audience are experienced users. You may find it useful if you want to master the marks or solve a specific problem about a mark.
If you are new to txt2tags or just want to know which are the available marks, please read the Markup Demo.
Note 1: This document is generated directly from the txt2tags test-suite. All the rules mentioned here are 100% in sync with the current program code.
Note 2: A good practice is to consult the sources when reading, to see how the texts were made.
Table of Contents:
A paragraph is composed by one or more lines. A blank line (or a table, or a list) ends the current paragraph.
Leading and trailing spaces are ignored.
A comment line can be placed inside a paragraph. It will not affect it.
The end of the file (EOF) closes the currently open paragraph.
% not on the line beginning (at column 2)
some text % half line comments are not allowed
Free mixing is allowed to make the line, but the first char is the identifier for the difference between separator ( - _ ) and strong ( = ) lines.
-----
----- ------
-----+------
( ---------------- )
GLUED: The contents must be glued with the marks, no spaces between them. Right after the opening mark there must be a non-blank character, as well as right before the closing mark.
GREEDY: If the contents boundary character is the same as the mark character, it is considered contents, not mark. So ****bold**** turns to <B>**bold**</B> in HTML.
{ b }{ i }{ u }{ s }{ m
}{ r }{ t }
{ bo }{ it }{ un }{ st }{ mo
}{ ra }{ tg }
{ bold }{ ital }{ undr }{ strk }{ mono
}{ raw }{ tggd }
{ bo ld }{ it al }{ un dr }{ st rk }{ mo no
}{ r aw }{ tg gd }
{ bo * ld }{ it / al }{ un _ dr }{ st - rk }{ mo ` no
}{ r " aw }{ tg ' gd }
{ bo **ld }{ it //al }{ un __dr }{ st --rk }{ mo ``no
}{ r ""aw }{ tg ''gd }
{ bo ** ld }{ it // al }{ un __ dr }{ st -- rk }{ mo `` no
}{ r "" aw }{ tg '' gd }
{ **bold** }{ //ital// }{ __undr__ }{ --strk-- }{ ``mono``
}{ ""raw"" }{ ''tggd'' }
{ *bold* }{ /ital/ }{ _undr_ }{ -strk- }{ `mono`
}{ "raw" }{ 'tggd' }
When the mark character is repeated many times, the contents are expanded to the largest possible. Thats why they are greedy, the outer marks are the ones used.
{ * }{ / }{ _ }{ - }{ `
}{ " }{ ' }
{ ** }{ // }{ __ }{ -- }{ ``
}{ "" }{ '' }
{ *** }{ /// }{ ___ }{ --- }{ ```
}{ """ }{ ''' }
{ **** }{ //// }{ ____ }{ ---- }{ ````
}{ """" }{ '''' }
{ ***** }{ ///// }{ _____ }{ ----- }{ `````
}{ """"" }{ ''''' }
{ ****** }{ ////// }{ ______ }{ ------ }{ ``````
}{ """""" }{ '''''' }
{ **** }{ //// }{ ____ }{ ---- }{ ```` }{ """" }{ '''' }
{ ** ** }{ // // }{ __ __ }{ -- -- }{ `` `` }{ "" "" }{ '' '' }
Spaces between the marks and the contents in any side invalidate the mark.
{ ** bold** }{ // ital// }{ __ undr__ }{ -- strk-- }{ `` mono`` }{ "" raw"" }{ '' tggd'' }
{ **bold ** }{ //ital // }{ __undr __ }{ --strk -- }{ ``mono `` }{ ""raw "" }{ ''tggd '' }
{ ** bold ** }{ // ital // }{ __ undr __ }{ -- strk -- }{ `` mono `` }{ "" raw "" }{ '' tggd '' }
user@domain.com
user@domain.com.
user@domain.com. any text.
any text: user@domain.com. any text.
label
user@domain.com?subject=bla
user@domain.com?subject=bla.
user@domain.com?subject=bla,
user@domain.com?subject=bla&cc=otheruser@domain.com
user@domain.com?subject=bla&cc=otheruser@domain.com.
user@domain.com?subject=bla&cc=otheruser@domain.com,
label.
label.
http://www.domain.com
http://www.domain.com/dir/
http://www.domain.com/dir///
http://www.domain.com.
http://www.domain.com,
http://www.domain.com. any text.
http://www.domain.com, any text.
http://www.domain.com/dir/. any text.
any text: http://www.domain.com. any text.
any text: http://www.domain.com/dir/. any text.
any text: http://www.domain.com/dir/index.html. any text.
any text: http://www.domain.com/dir/index.html, any text.
http://www.domain.com/dir/#anchor
http://www.domain.com/dir/index.html#anchor
http://www.domain.com/dir/index.html#anchor.
http://www.domain.com/dir/#anchor. any text.
http://www.domain.com/dir/index.html#anchor. any text.
any text: http://www.domain.com/dir/#anchor. any text.
any text: http://www.domain.com/dir/index.html#anchor. any text.
http://domain.com?a=a@a.a&b=a+b+c.
http://domain.com?a=a@a.a&b=a+b+c,
http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.
http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.
http://domain.com?a=a@a.a&b=a+b+c.#anchor
http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor
http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.#anchor
http://user:password@domain.com/bla.html.
http://user:password@domain.com/dir/.
http://user:password@domain.com.
http://user:@domain.com.
http://user@domain.com.
http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor
http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c@#anchor
anchor
login
form
form & anchor
login & form
local link up
local link file
local link anchor
local link file/anchor
local link file/anchor
local link img
http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm
http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-
http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_-1%.
http://foo._user-9:pass!#$%&*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_-1%.
http://L1.com ! L2@www.com ! L3 ! L4 ! www.L5.com
www.domain.com
www2.domain.com
ftp.domain.com
WWW.DOMAIN.COM
FTP.DOMAIN.COM
label
label
label
label
[label www.domain.com ]
[label] www.domain.com]
Image at the line beginning.
Image in the middle of the line.
Image at the line end.
Images mixed with text.
Images glued together: .
[../img/t2tpowered.png ]
[ ../img/t2tpowered.png]
[ ../img/t2tpowered.png ]
Date : 20081027 - 20081027
Mtime : 20081027 - 20081027
Infile : rules.t2t - rules.t2t
Outfile : rules.html - rules.html
Date : 20081027
Mtime : 20081027
Infile : rules.t2t
Outfile : rules.html
Date : txt 20 txt
Mtime : txt 20 txt
Infile : txt t2t txt
Outfile : txt html txt
Date : ( txt ) - ( 20 )
Mtime : ( txt ) - ( 20 )
Infile : ( txt ) - ( t2t )
Outfile : ( txt ) - ( html )
Date : % - % - %% - %%
Mtime : % - % - %% - %%
Infile : % - % - %% - %%
Outfile : % - % - %% - %%
Date : 202008102720081027
Mtime : 202008102720081027
Infile : t2trules.t2trules.t2t
Outfile : htmlrules.htmlrules.html
Path : /a/pessoal/sourceforge.net/txt2tags/src/doc/English/rules/rules.t2t
Path : /a/pessoal/sourceforge.net/txt2tags/src/doc/English/rules.html
Dirname : /a/pessoal/sourceforge.net/txt2tags/src/doc/English/rules, rules
Dirname : /a/pessoal/sourceforge.net/txt2tags/src/doc/English, English
File : rules + t2t = rules.t2t
File : rules + html = rules.html
See Title, the same rules apply.
=Not Title
==Not Title=
===Not Title====
======Not Title 6======
=======Not Title 7=======
=Not Title= [label1]
=Not Title=[ label ]
=Not Title=[la/bel]
To quote a paragraph, just prefix it by a TAB character. All the lines of the paragraph must begin with a TAB.
Any non-tabbed line closes the quote block.
The number of leading TABs identifies the quote block depth. This is quote level 1.With two TABs, we are on the quote level 2.The more TABs, more deep is the quote level.There isn't a limit.
Until the level 1.Counting down, one by one.This quote starts at level 4.Then its depth is decreased.
The TAB count don't need to be incremental by one.Unlike lists, any quote block is independent, not part of a tree.Quotes can be opened and closed in any way.The nesting don't need to follow any rule.You choose.
Some targets (as sgml) don't support the nesting of quotes. There is only one quote level.In this case, no matter how much TABs are used to define the quote block, it always will be level 1.
Spaces AFTER the TAB character are allowed. But be careful, it can be confusing.
Spaces BEFORE the TAB character invalidate the mark. It's not quote.
Paragraph breaks inside a quote aren't possible.
This sample are two separated quoted paragraphs, not a quote block with two paragraphs inside.
The end of the file (EOF) closes the currently open quote block.
See Verbatim, the same rules apply.
See Verbatim, the same rules apply.
A verbatim line.
Another verbatim line, with leading spaces.
A verbatim area delimited by lines with marks.
Trailing spaces and TABs after the area marks are allowed, but not encouraged nor documented.
```Not a verbatim line, need one space after mark.
``` Not a verbatim area. The marks must be at the line beginning, no leading spaces. ```
The end of the file (EOF) closes the currently open verbatim area.
See List, the same rules apply.
See List, the same rules apply.
-This is not a list (no space)
- This is not a list (more than one space)
- This is not a list (a TAB instead the space)
When nesting back to an upper level, the previous sublist is automatically closed.
More than one list can be closed when nesting back.
Be careful when going back on the nesting, it must be on a valid level! If not, it will be bumped up to the previous valid level.
The two blank lines closes ALL the lists. To close just the current, use an empty item.
The empty item can have trailing blanks.
Cell 1 |
Cell 1 | Cell 2 | Cell 3 |
Cell 1 | Cell 2 | Cell 3 |
Cell 1 | Cell 2 | Cell 3 |
---|
Cell 1 | Cell 2 | Cell 3 |
Heading | Heading | Heading |
---|---|---|
<- | -- | -> |
-- | -- | -- |
-> | -- | <- |
1 | 2 | 3+4 | |
---|---|---|---|
1 | 2 | 3 | 4 |
1+2+3 | 4 | ||
1 | 2+3 | 4 | |
1+2+3+4 |
0 | 1 | 2 | |
4 | 5 | 7 | |
8 | A | B | |
D | E | F |
1 | ||||
1 | 2 | |||
1 | 2 | 3 | ||
1 | 2 | 3 | 4 | |
1 | 2 | 3 | 4 | 5 |
Jan | ||||
Fev | ||||
Mar | ||||
Apr | ||||
May | ||||
20% | 40% | 60% | 80% | 100% |
/ | ||||
/ / / / / | ||||
/ / / / / / / / / | ||||
o | o | |||
. | ||||
= = = = |
01 | 02 | 05 | 07 | ||||
11 | 13 | 16 | |||||
17 | 19 | 20 | 23 | ||||
25 | 26 | 29 | 30 | 32 | |||
35 | 37 | 39 | 40 |
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|this|is|not|a|table|
|this| is| not| a| table|
|this |is |not |a |table |
| this | is | not | a | table |
The End.