/doc/English/rules.html

http://txt2tags.googlecode.com/ · HTML · 1757 lines · 1708 code · 46 blank · 3 comment · 0 complexity · b075cb8077777e6fe2a3cd7d3638590d MD5 · raw file

  1. <?xml version="1.0"
  2. ?>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <title>Txt2tags Markup Rules</title>
  7. <meta name="generator" content="http://txt2tags.org" />
  8. <!-- Included /a/pessoal/sourceforge.net/txt2tags/src/doc/English/rules/rules.css -->
  9. <style type="text/css">
  10. body {
  11. margin:2em;
  12. }
  13. a {
  14. font-weight:bold;
  15. text-decoration:none;
  16. }
  17. a:hover {
  18. text-decoration:underline;
  19. }
  20. .toc {
  21. margin-left:2em;
  22. }
  23. .section {
  24. margin-top:2em;
  25. margin-bottom:1em;
  26. border:1px solid black;
  27. text-align:center;
  28. background-color:#ddd;
  29. }
  30. table {
  31. empty-cells:hide;
  32. }
  33. td {
  34. padding:4px;
  35. }
  36. </style>
  37. </head>
  38. <body>
  39. <div class="header" id="header">
  40. <h1>Txt2tags Markup Rules</h1>
  41. </div>
  42. <div class="body" id="body">
  43. <p>
  44. This document describes all the details about each txt2tags mark.
  45. The target audience are <b>experienced</b> users. You may find it
  46. useful if you want to master the marks or solve a specific problem
  47. about a mark.
  48. </p>
  49. <p>
  50. If you are new to txt2tags or just want to know which are the
  51. available marks, please read the <a href="markup.html">Markup Demo</a>.
  52. </p>
  53. <p>
  54. Note 1: This document is generated directly from the txt2tags
  55. test-suite. All the rules mentioned here are 100% in sync with the
  56. current program code.
  57. </p>
  58. <p>
  59. Note 2: A good practice is to consult <a href="rules.t2t">the sources</a> when
  60. reading, to see how the texts were made.
  61. </p>
  62. <p>
  63. Table of Contents:
  64. </p>
  65. <div class="toc" id="toc">
  66. <ul>
  67. <li><a href="#paragraph">Paragraph</a>
  68. <ul>
  69. <li><a href="#toc2">Syntax: Lines grouped together</a>
  70. </li>
  71. <li><a href="#toc3">Syntax: Leading and trailing spaces are ignored</a>
  72. </li>
  73. <li><a href="#toc4">Syntax: A comment don't close a paragraph</a>
  74. </li>
  75. <li><a href="#toc5">Closing: EOF closes the open paragraph</a>
  76. </li>
  77. </ul>
  78. </li>
  79. <li><a href="#comment">Comment</a>
  80. <ul>
  81. <li><a href="#toc7">Syntax: The % character at the line beginning (column 1)</a>
  82. </li>
  83. <li><a href="#toc8">Syntax: Area (block)</a>
  84. </li>
  85. <li><a href="#toc9">Syntax: Area (block) with trailing spaces</a>
  86. </li>
  87. <li><a href="#toc10">Invalid: The % in any other position</a>
  88. </li>
  89. </ul>
  90. </li>
  91. <li><a href="#line">Line</a>
  92. <ul>
  93. <li><a href="#toc12">Syntax: At least 20 chars of - = _</a>
  94. </li>
  95. <li><a href="#toc13">Syntax: Any kind of mixing is allowed</a>
  96. </li>
  97. <li><a href="#toc14">Syntax: Leading and/or trailing spaces are allowed</a>
  98. </li>
  99. <li><a href="#toc15">Invalid: Less than 20 chars (but strike matches)</a>
  100. </li>
  101. <li><a href="#toc16">Invalid: Strange chars (but strike matches)</a>
  102. </li>
  103. </ul>
  104. </li>
  105. <li><a href="#inline">Inline</a>
  106. <ul>
  107. <li><a href="#toc18">Syntax: Marks are greedy and must be "glued" with contents</a>
  108. </li>
  109. <li><a href="#toc19">Syntax: Repetition is greedy</a>
  110. </li>
  111. <li><a href="#toc20">Invalid: No contents</a>
  112. </li>
  113. <li><a href="#toc21">Invalid: Contents not "glued" with marks</a>
  114. </li>
  115. </ul>
  116. </li>
  117. <li><a href="#link">Link</a>
  118. <ul>
  119. <li><a href="#toc23">Syntax: E-mail</a>
  120. </li>
  121. <li><a href="#toc24">Syntax: E-mail with form data</a>
  122. </li>
  123. <li><a href="#toc25">Syntax: URL</a>
  124. </li>
  125. <li><a href="#toc26">Syntax: URL with anchor</a>
  126. </li>
  127. <li><a href="#toc27">Syntax: URL with form data</a>
  128. </li>
  129. <li><a href="#toc28">Syntax: URL with form data and anchor</a>
  130. </li>
  131. <li><a href="#toc29">Syntax: URL with login data</a>
  132. </li>
  133. <li><a href="#toc30">Syntax: URL with login, form and anchor</a>
  134. </li>
  135. <li><a href="#toc31">Syntax: URL with label</a>
  136. </li>
  137. <li><a href="#toc32">Syntax: URL with label (trailing spaces are discarded, leading are maintained)</a>
  138. </li>
  139. <li><a href="#toc33">Syntax: URL with label, stressing</a>
  140. </li>
  141. <li><a href="#toc34">Syntax: Link with label for local files</a>
  142. </li>
  143. <li><a href="#toc35">Syntax: Another link as a label</a>
  144. </li>
  145. <li><a href="#toc36">Syntax: URL with funny chars</a>
  146. </li>
  147. <li><a href="#toc37">Test: Various per line</a>
  148. </li>
  149. <li><a href="#toc38">Feature: Guessed link, adding protocol automatically</a>
  150. </li>
  151. <li><a href="#toc39">Invalid: Trailing space on link</a>
  152. </li>
  153. <li><a href="#toc40">Invalid: Label with ] char (use postproc)</a>
  154. </li>
  155. </ul>
  156. </li>
  157. <li><a href="#image">Image</a>
  158. <ul>
  159. <li><a href="#toc42">Syntax: Image name inside brackets: [img]</a>
  160. </li>
  161. <li><a href="#toc43">Syntax: Image pointing to a link: [[img] link]</a>
  162. </li>
  163. <li><a href="#toc44">Align: Image position is preserved when inside paragraph</a>
  164. </li>
  165. <li><a href="#toc45">Align: Image alone with spaces around is aligned</a>
  166. </li>
  167. <li><a href="#toc46">Test: Two glued images with no spaces (left &amp; right)</a>
  168. </li>
  169. <li><a href="#toc47">Test: Various per line</a>
  170. </li>
  171. <li><a href="#toc48">Invalid: Spaces inside are not allowed</a>
  172. </li>
  173. </ul>
  174. </li>
  175. <li><a href="#macro">Macro</a>
  176. <ul>
  177. <li><a href="#toc50">Syntax: Macro without formatting string</a>
  178. </li>
  179. <li><a href="#toc51">Syntax: Macro name is case insensitive</a>
  180. </li>
  181. <li><a href="#toc52">Syntax: Macro with formatting string</a>
  182. </li>
  183. <li><a href="#toc53">Syntax: Leading and trailing spaces are preserved</a>
  184. </li>
  185. <li><a href="#toc54">Test: Expansion of the percent char</a>
  186. </li>
  187. <li><a href="#toc55">Test: Various per line, glued</a>
  188. </li>
  189. <li><a href="#toc56">Test: Path formatters</a>
  190. </li>
  191. </ul>
  192. </li>
  193. <li><a href="#numtitle">Numbered Title</a>
  194. </li>
  195. <li><a href="#title">Title</a>
  196. <ul>
  197. <li><a href="#toc59">Syntax: Balanced equal signs (from 1 to 5)</a>
  198. </li>
  199. </ul>
  200. </li>
  201. <ul>
  202. </li>
  203. <li><a href="#toc62">Label: Between brackets, alphanumeric [A-Za-z0-9_-]</a>
  204. </li>
  205. </ul>
  206. </li>
  207. <ul>
  208. </li>
  209. <li><a href="#toc65">Syntax: Spaces around and/or inside are allowed (and ignored)</a>
  210. </li>
  211. <li><a href="#toc66">Invalid: Unbalanced equal signs</a>
  212. </li>
  213. <li><a href="#toc67">Invalid: Level deeper than 5</a>
  214. </li>
  215. <li><a href="#toc68">Invalid: Space between title and label</a>
  216. </li>
  217. <li><a href="#toc69">Invalid: Space inside label</a>
  218. </li>
  219. <li><a href="#toc70">Invalid: Strange chars inside label</a>
  220. </li>
  221. </ul>
  222. </li>
  223. <li><a href="#quote">Quote</a>
  224. <ul>
  225. <li><a href="#toc72">Syntax: TAB defines quote</a>
  226. </li>
  227. <li><a href="#toc73">Nesting: Creating deeper quotes</a>
  228. </li>
  229. <li><a href="#toc74">Nesting: Reverse nesting works</a>
  230. </li>
  231. <li><a href="#toc75">Nesting: Random count</a>
  232. </li>
  233. <li><a href="#toc76">Nesting: When not supported</a>
  234. </li>
  235. <li><a href="#toc77">Syntax: Spaces after TAB</a>
  236. </li>
  237. <li><a href="#toc78">Invalid: Spaces before TAB</a>
  238. </li>
  239. <li><a href="#toc79">Invalid: Paragraphs inside</a>
  240. </li>
  241. <li><a href="#toc80">Closing: EOF closes the open block</a>
  242. </li>
  243. </ul>
  244. </li>
  245. <li><a href="#raw">Raw</a>
  246. </li>
  247. <li><a href="#tagged">Tagged</a>
  248. </li>
  249. <li><a href="#verbatim">Verbatim</a>
  250. <ul>
  251. <li><a href="#toc84">Syntax: A single line</a>
  252. </li>
  253. <li><a href="#toc85">Syntax: A single line with leading spaces</a>
  254. </li>
  255. <li><a href="#toc86">Syntax: Area (block)</a>
  256. </li>
  257. <li><a href="#toc87">Syntax: Area (block) with trailing spaces</a>
  258. </li>
  259. <li><a href="#toc88">Invalid: No space between mark and contents</a>
  260. </li>
  261. <li><a href="#toc89">Invalid: Leading spaces on block marks</a>
  262. </li>
  263. <li><a href="#toc90">Closing: EOF closes the open block</a>
  264. </li>
  265. </ul>
  266. </li>
  267. <li><a href="#deflist">Definition List</a>
  268. </li>
  269. <li><a href="#numlist">Numbered List</a>
  270. </li>
  271. <li><a href="#list">List</a>
  272. <ul>
  273. <li><a href="#toc94">Items: Prefixed by hyphen</a>
  274. </li>
  275. <li><a href="#toc95">Items: Free leading spacing (indentation)</a>
  276. </li>
  277. <li><a href="#toc96">Items: Vertical spacing between items</a>
  278. </li>
  279. <li><a href="#toc97">Items: Exactly ONE space after the hyphen</a>
  280. </li>
  281. <li><a href="#toc98">Items: Catchy cases</a>
  282. </li>
  283. <li><a href="#toc99">Nesting: Creating sublists</a>
  284. </li>
  285. <li><a href="#toc100">Nesting: Free leading spacing (indentation)</a>
  286. </li>
  287. <li><a href="#toc101">Nesting: Maximum depth</a>
  288. </li>
  289. <li><a href="#toc102">Nesting: Reverse doesn't work</a>
  290. </li>
  291. <li><a href="#toc103">Nesting: Going deeper and back</a>
  292. </li>
  293. <li><a href="#toc104">Nesting: Vertical spacing between lists</a>
  294. </li>
  295. <li><a href="#toc105">Nesting: Messing up</a>
  296. </li>
  297. <li><a href="#toc106">Closing: Two (not so) empty lines</a>
  298. </li>
  299. <li><a href="#toc107">Closing: Empty item closes current (sub)list</a>
  300. </li>
  301. <li><a href="#toc108">Closing: EOF closes the lists</a>
  302. </li>
  303. </ul>
  304. </li>
  305. <li><a href="#table">Table</a>
  306. <ul>
  307. <li><a href="#toc110">Syntax: Lines starting with a pipe |</a>
  308. </li>
  309. <li><a href="#toc111">Syntax: Extra pipes separate cells</a>
  310. </li>
  311. <li><a href="#toc112">Syntax: With a trailing pipe, make border</a>
  312. </li>
  313. <li><a href="#toc113">Syntax: Table lines starting with double pipe are heading</a>
  314. </li>
  315. <li><a href="#toc114">Align: Spaces before the leading pipe centralize the table</a>
  316. </li>
  317. <li><a href="#toc115">Align: Spaces inside the cell denote its alignment</a>
  318. </li>
  319. <li><a href="#toc116">Span: Column span is defined by extra pipes at cell closing</a>
  320. </li>
  321. <li><a href="#toc117">Test: Empty cells are placed as expected</a>
  322. </li>
  323. <li><a href="#toc118">Test: Lines with different number of cells</a>
  324. </li>
  325. <li><a href="#toc119">Test: Empty cells + Span + Messy cell number = Fun!</a>
  326. </li>
  327. <li><a href="#toc120">Test: Lots of cells at the same line</a>
  328. </li>
  329. <li><a href="#toc121">Test: Empty lines</a>
  330. </li>
  331. <li><a href="#toc122">Invalid: There must be at least one space around the pipe</a>
  332. </li>
  333. <li><a href="#toc123">Invalid: You must use spaces, not TABs</a>
  334. </li>
  335. </ul>
  336. </li>
  337. </ul>
  338. </div>
  339. <p></p>
  340. <hr class="light" />
  341. <p></p>
  342. <a id="paragraph" name="paragraph"></a>
  343. <h1 class="section">Paragraph</h1>
  344. <a id="toc2" name="toc2"></a>
  345. <h2>Syntax: Lines grouped together</h2>
  346. <p>
  347. A paragraph is composed by one or more lines.
  348. A blank line (or a table, or a list) ends the
  349. current paragraph.
  350. </p>
  351. <a id="toc3" name="toc3"></a>
  352. <h2>Syntax: Leading and trailing spaces are ignored</h2>
  353. <p>
  354. Leading and trailing spaces are ignored.
  355. </p>
  356. <a id="toc4" name="toc4"></a>
  357. <h2>Syntax: A comment don't close a paragraph</h2>
  358. <p>
  359. A comment line can be placed inside a paragraph.
  360. It will not affect it.
  361. </p>
  362. <a id="toc5" name="toc5"></a>
  363. <h2>Closing: EOF closes the open paragraph</h2>
  364. <p>
  365. The end of the file (EOF) closes the
  366. currently open paragraph.
  367. </p>
  368. <a id="comment" name="comment"></a>
  369. <h1 class="section">Comment</h1>
  370. <a id="toc7" name="toc7"></a>
  371. <h2>Syntax: The % character at the line beginning (column 1)</h2>
  372. <a id="toc8" name="toc8"></a>
  373. <h2>Syntax: Area (block)</h2>
  374. <a id="toc9" name="toc9"></a>
  375. <h2>Syntax: Area (block) with trailing spaces</h2>
  376. <a id="toc10" name="toc10"></a>
  377. <h2>Invalid: The % in any other position</h2>
  378. <p>
  379. % not on the line beginning (at column 2)
  380. </p>
  381. <p>
  382. some text % half line comments are not allowed
  383. </p>
  384. <a id="line" name="line"></a>
  385. <h1 class="section">Line</h1>
  386. <a id="toc12" name="toc12"></a>
  387. <h2>Syntax: At least 20 chars of - = _</h2>
  388. <hr class="light" />
  389. <hr class="heavy" />
  390. <hr class="light" />
  391. <a id="toc13" name="toc13"></a>
  392. <h2>Syntax: Any kind of mixing is allowed</h2>
  393. <p>
  394. Free mixing is allowed to make the line,
  395. but the first char is the identifier for
  396. the difference between separator ( - _ )
  397. and strong ( = ) lines.
  398. </p>
  399. <hr class="heavy" />
  400. <hr class="light" />
  401. <hr class="heavy" />
  402. <hr class="heavy" />
  403. <hr class="light" />
  404. <a id="toc14" name="toc14"></a>
  405. <h2>Syntax: Leading and/or trailing spaces are allowed</h2>
  406. <hr class="light" />
  407. <hr class="light" />
  408. <hr class="light" />
  409. <a id="toc15" name="toc15"></a>
  410. <h2>Invalid: Less than 20 chars (but strike matches)</h2>
  411. <p>
  412. <s>-----</s>
  413. </p>
  414. <a id="toc16" name="toc16"></a>
  415. <h2>Invalid: Strange chars (but strike matches)</h2>
  416. <p>
  417. <s>-----</s> <s>------</s>
  418. </p>
  419. <p>
  420. <s>-----</s>+<s>------</s>
  421. </p>
  422. <p>
  423. ( <s>----------------</s> )
  424. </p>
  425. <a id="inline" name="inline"></a>
  426. <h1 class="section">Inline</h1>
  427. <a id="toc18" name="toc18"></a>
  428. <h2>Syntax: Marks are greedy and must be "glued" with contents</h2>
  429. <p>
  430. GLUED: The contents must be glued with the marks, no spaces
  431. between them. Right after the opening mark there must be a
  432. non-blank character, as well as right before the closing mark.
  433. </p>
  434. <p>
  435. GREEDY: If the contents boundary character is the same as
  436. the mark character, it is considered contents, not mark.
  437. So ****bold**** turns to &lt;B&gt;**bold**&lt;/B&gt; in HTML.
  438. </p>
  439. <p>
  440. { <b>b</b> }{ <i>i</i> }{ <u>u</u> }{ <s>s</s> }{ <code>m</code> }{ r }{ t }<br />
  441. { <b>bo</b> }{ <i>it</i> }{ <u>un</u> }{ <s>st</s> }{ <code>mo</code> }{ ra }{ tg }<br />
  442. { <b>bold</b> }{ <i>ital</i> }{ <u>undr</u> }{ <s>strk</s> }{ <code>mono</code> }{ raw }{ tggd }<br />
  443. { <b>bo ld</b> }{ <i>it al</i> }{ <u>un dr</u> }{ <s>st rk</s> }{ <code>mo no</code> }{ r aw }{ tg gd }<br />
  444. { <b>bo * ld</b> }{ <i>it / al</i> }{ <u>un _ dr</u> }{ <s>st - rk</s> }{ <code>mo ` no</code> }{ r " aw }{ tg ' gd }<br />
  445. { <b>bo **ld</b> }{ <i>it //al</i> }{ <u>un __dr</u> }{ <s>st --rk</s> }{ <code>mo ``no</code> }{ r ""aw }{ tg ''gd }<br />
  446. { <b>bo ** ld</b> }{ <i>it // al</i> }{ <u>un __ dr</u> }{ <s>st -- rk</s> }{ <code>mo `` no</code> }{ r "" aw }{ tg '' gd }<br />
  447. { <b>**bold**</b> }{ <i>//ital//</i> }{ <u>__undr__</u> }{ <s>--strk--</s> }{ <code>``mono``</code> }{ ""raw"" }{ ''tggd'' }<br />
  448. { <b>*bold*</b> }{ <i>/ital/</i> }{ <u>_undr_</u> }{ <s>-strk-</s> }{ <code>`mono`</code> }{ "raw" }{ 'tggd' }<br />
  449. </p>
  450. <a id="toc19" name="toc19"></a>
  451. <h2>Syntax: Repetition is greedy</h2>
  452. <p>
  453. When the mark character is repeated many times,
  454. the contents are expanded to the largest possible.
  455. Thats why they are greedy, the outer marks are
  456. the ones used.
  457. </p>
  458. <p>
  459. { <b>*</b> }{ <i>/</i> }{ <u>_</u> }{ <s>-</s> }{ <code>`</code> }{ " }{ ' }<br />
  460. { <b>**</b> }{ <i>//</i> }{ <u>__</u> }{ <s>--</s> }{ <code>``</code> }{ "" }{ '' }<br />
  461. { <b>***</b> }{ <i>///</i> }{ <u>___</u> }{ <s>---</s> }{ <code>```</code> }{ """ }{ ''' }<br />
  462. { <b>****</b> }{ <i>////</i> }{ <u>____</u> }{ <s>----</s> }{ <code>````</code> }{ """" }{ '''' }<br />
  463. { <b>*****</b> }{ <i>/////</i> }{ <u>_____</u> }{ <s>-----</s> }{ <code>`````</code> }{ """"" }{ ''''' }<br />
  464. { <b>******</b> }{ <i>//////</i> }{ <u>______</u> }{ <s>------</s> }{ <code>``````</code> }{ """""" }{ '''''' }<br />
  465. </p>
  466. <a id="toc20" name="toc20"></a>
  467. <h2>Invalid: No contents</h2>
  468. <p>
  469. { **** }{ //// }{ ____ }{ ---- }{ ```` }{ """" }{ '''' }<br />
  470. { ** ** }{ // // }{ __ __ }{ -- -- }{ `` `` }{ "" "" }{ '' '' }<br />
  471. </p>
  472. <a id="toc21" name="toc21"></a>
  473. <h2>Invalid: Contents not "glued" with marks</h2>
  474. <p>
  475. Spaces between the marks and the contents in any side
  476. invalidate the mark.
  477. </p>
  478. <p>
  479. { ** bold** }{ // ital// }{ __ undr__ }{ -- strk-- }{ `` mono`` }{ "" raw"" }{ '' tggd'' }<br />
  480. { **bold ** }{ //ital // }{ __undr __ }{ --strk -- }{ ``mono `` }{ ""raw "" }{ ''tggd '' }<br />
  481. { ** bold ** }{ // ital // }{ __ undr __ }{ -- strk -- }{ `` mono `` }{ "" raw "" }{ '' tggd '' }<br />
  482. </p>
  483. <a id="link" name="link"></a>
  484. <h1 class="section">Link</h1>
  485. <a id="toc23" name="toc23"></a>
  486. <h2>Syntax: E-mail</h2>
  487. <p>
  488. <a href="mailto:user@domain.com">user@domain.com</a><br />
  489. <a href="mailto:user@domain.com">user@domain.com</a>.<br />
  490. <a href="mailto:user@domain.com">user@domain.com</a>. any text.<br />
  491. any text: <a href="mailto:user@domain.com">user@domain.com</a>. any text.<br />
  492. <a href="mailto:user@domain.com">label</a><br />
  493. </p>
  494. <a id="toc24" name="toc24"></a>
  495. <h2>Syntax: E-mail with form data</h2>
  496. <p>
  497. <a href="mailto:user@domain.com?subject=bla">user@domain.com?subject=bla</a><br />
  498. <a href="mailto:user@domain.com?subject=bla.">user@domain.com?subject=bla.</a><br />
  499. <a href="mailto:user@domain.com?subject=bla,">user@domain.com?subject=bla,</a><br />
  500. <a href="mailto:user@domain.com?subject=bla&amp;cc=otheruser@domain.com">user@domain.com?subject=bla&amp;cc=otheruser@domain.com</a><br />
  501. <a href="mailto:user@domain.com?subject=bla&amp;cc=otheruser@domain.com.">user@domain.com?subject=bla&amp;cc=otheruser@domain.com.</a><br />
  502. <a href="mailto:user@domain.com?subject=bla&amp;cc=otheruser@domain.com,">user@domain.com?subject=bla&amp;cc=otheruser@domain.com,</a><br />
  503. <a href="mailto:user@domain.com?subject=bla&amp;cc=otheruser@domain.com">label</a>.<br />
  504. <a href="mailto:user@domain.com?subject=bla&amp;cc=otheruser@domain.com.">label</a>.<br />
  505. </p>
  506. <a id="toc25" name="toc25"></a>
  507. <h2>Syntax: URL</h2>
  508. <p>
  509. <a href="http://www.domain.com">http://www.domain.com</a><br />
  510. <a href="http://www.domain.com/dir/">http://www.domain.com/dir/</a><br />
  511. <a href="http://www.domain.com/dir///">http://www.domain.com/dir///</a><br />
  512. <a href="http://www.domain.com">http://www.domain.com</a>.<br />
  513. <a href="http://www.domain.com">http://www.domain.com</a>,<br />
  514. <a href="http://www.domain.com">http://www.domain.com</a>. any text.<br />
  515. <a href="http://www.domain.com">http://www.domain.com</a>, any text.<br />
  516. <a href="http://www.domain.com/dir/">http://www.domain.com/dir/</a>. any text.<br />
  517. any text: <a href="http://www.domain.com">http://www.domain.com</a>. any text.<br />
  518. any text: <a href="http://www.domain.com/dir/">http://www.domain.com/dir/</a>. any text.<br />
  519. any text: <a href="http://www.domain.com/dir/index.html">http://www.domain.com/dir/index.html</a>. any text.<br />
  520. any text: <a href="http://www.domain.com/dir/index.html">http://www.domain.com/dir/index.html</a>, any text.<br />
  521. </p>
  522. <a id="toc26" name="toc26"></a>
  523. <h2>Syntax: URL with anchor</h2>
  524. <p>
  525. <a href="http://www.domain.com/dir/#anchor">http://www.domain.com/dir/#anchor</a><br />
  526. <a href="http://www.domain.com/dir/index.html#anchor">http://www.domain.com/dir/index.html#anchor</a><br />
  527. <a href="http://www.domain.com/dir/index.html#anchor.">http://www.domain.com/dir/index.html#anchor.</a><br />
  528. <a href="http://www.domain.com/dir/#anchor.">http://www.domain.com/dir/#anchor.</a> any text.<br />
  529. <a href="http://www.domain.com/dir/index.html#anchor.">http://www.domain.com/dir/index.html#anchor.</a> any text.<br />
  530. any text: <a href="http://www.domain.com/dir/#anchor.">http://www.domain.com/dir/#anchor.</a> any text.<br />
  531. any text: <a href="http://www.domain.com/dir/index.html#anchor.">http://www.domain.com/dir/index.html#anchor.</a> any text.<br />
  532. </p>
  533. <a id="toc27" name="toc27"></a>
  534. <h2>Syntax: URL with form data</h2>
  535. <p>
  536. <a href="http://domain.com?a=a@a.a&amp;b=a+b+c.">http://domain.com?a=a@a.a&amp;b=a+b+c.</a><br />
  537. <a href="http://domain.com?a=a@a.a&amp;b=a+b+c,">http://domain.com?a=a@a.a&amp;b=a+b+c,</a><br />
  538. <a href="http://domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c.">http://domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c.</a><br />
  539. <a href="http://domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c@.">http://domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c@.</a><br />
  540. </p>
  541. <a id="toc28" name="toc28"></a>
  542. <h2>Syntax: URL with form data and anchor</h2>
  543. <p>
  544. <a href="http://domain.com?a=a@a.a&amp;b=a+b+c.#anchor">http://domain.com?a=a@a.a&amp;b=a+b+c.#anchor</a><br />
  545. <a href="http://domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c.#anchor">http://domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c.#anchor</a><br />
  546. <a href="http://domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c@.#anchor">http://domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c@.#anchor</a><br />
  547. </p>
  548. <a id="toc29" name="toc29"></a>
  549. <h2>Syntax: URL with login data</h2>
  550. <p>
  551. <a href="http://user:password@domain.com/bla.html">http://user:password@domain.com/bla.html</a>.<br />
  552. <a href="http://user:password@domain.com/dir/">http://user:password@domain.com/dir/</a>.<br />
  553. <a href="http://user:password@domain.com">http://user:password@domain.com</a>.<br />
  554. <a href="http://user:@domain.com">http://user:@domain.com</a>.<br />
  555. <a href="http://user@domain.com">http://user@domain.com</a>.<br />
  556. </p>
  557. <a id="toc30" name="toc30"></a>
  558. <h2>Syntax: URL with login, form and anchor</h2>
  559. <p>
  560. <a href="http://user:password@domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c.#anchor">http://user:password@domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c.#anchor</a><br />
  561. <a href="http://user:password@domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c@#anchor">http://user:password@domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c@#anchor</a><br />
  562. </p>
  563. <a id="toc31" name="toc31"></a>
  564. <h2>Syntax: URL with label</h2>
  565. <p>
  566. <a href="http://www.domain.com">label</a><br />
  567. </p>
  568. <a id="toc32" name="toc32"></a>
  569. <h2>Syntax: URL with label (trailing spaces are discarded, leading are maintained)</h2>
  570. <p>
  571. <a href="http://www.domain.com"> label</a><br />
  572. <a href="http://www.domain.com">label</a><br />
  573. </p>
  574. <a id="toc33" name="toc33"></a>
  575. <h2>Syntax: URL with label, stressing</h2>
  576. <p>
  577. <a href="http://www.domain.com/dir/index.html#anchor.">anchor</a><br />
  578. <a href="http://user:password@domain.com/bla.html">login</a><br />
  579. <a href="http://www.domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c.">form</a><br />
  580. <a href="http://www.domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c.#anchor">form &amp; anchor</a><br />
  581. <a href="http://user:password@domain.com/bla.cgi?a=a@a.a&amp;b=a+b+c.">login &amp; form</a><br />
  582. </p>
  583. <a id="toc34" name="toc34"></a>
  584. <h2>Syntax: Link with label for local files</h2>
  585. <p>
  586. <a href="..">local link up</a><br />
  587. <a href="bla.html">local link file</a><br />
  588. <a href="#anchor">local link anchor</a><br />
  589. <a href="bla.html#anchor">local link file/anchor</a><br />
  590. <a href="bla.html#anchor.">local link file/anchor</a><br />
  591. <a href="abc.gif">local link img</a><br />
  592. </p>
  593. <a id="toc35" name="toc35"></a>
  594. <h2>Syntax: Another link as a label</h2>
  595. <p>
  596. <a href="http://www.domain.com">www.fake.com</a><br />
  597. </p>
  598. <a id="toc36" name="toc36"></a>
  599. <h2>Syntax: URL with funny chars</h2>
  600. <p>
  601. <a href="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><br />
  602. <a href="http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&amp;b=+.@*_-">http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&amp;b=+.@*_-</a><br />
  603. <a href="http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&amp;b=+.@*_-#anchor_-1%.">http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&amp;b=+.@*_-#anchor_-1%.</a><br />
  604. <a href="http://foo._user-9:pass!#$%&amp;*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&amp;b=+.@*_-#anchor_-1%.">http://foo._user-9:pass!#$%&amp;*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&amp;b=+.@*_-#anchor_-1%.</a><br />
  605. </p>
  606. <a id="toc37" name="toc37"></a>
  607. <h2>Test: Various per line</h2>
  608. <p>
  609. <a href="http://L1.com">http://L1.com</a> ! <a href="mailto:L2@www.com">L2@www.com</a> ! <a href="http://www.com">L3</a> ! <a href="mailto:w@ww.com">L4</a> ! <a href="http://www.L5.com">www.L5.com</a><br />
  610. </p>
  611. <a id="toc38" name="toc38"></a>
  612. <h2>Feature: Guessed link, adding protocol automatically</h2>
  613. <p>
  614. <a href="http://www.domain.com">www.domain.com</a><br />
  615. <a href="http://www2.domain.com">www2.domain.com</a><br />
  616. <a href="ftp://ftp.domain.com">ftp.domain.com</a><br />
  617. <a href="http://WWW.DOMAIN.COM">WWW.DOMAIN.COM</a><br />
  618. <a href="ftp://FTP.DOMAIN.COM">FTP.DOMAIN.COM</a><br />
  619. <a href="http://www.domain.com">label</a><br />
  620. <a href="ftp://ftp.domain.com">label</a><br />
  621. <a href="http://WWW.DOMAIN.COM">label</a><br />
  622. <a href="ftp://FTP.DOMAIN.COM">label</a><br />
  623. </p>
  624. <a id="toc39" name="toc39"></a>
  625. <h2>Invalid: Trailing space on link</h2>
  626. <p>
  627. [label <a href="http://www.domain.com">www.domain.com</a> ]
  628. </p>
  629. <a id="toc40" name="toc40"></a>
  630. <h2>Invalid: Label with ] char (use postproc)</h2>
  631. <p>
  632. [label] <a href="http://www.domain.com">www.domain.com</a>]
  633. </p>
  634. <a id="image" name="image"></a>
  635. <h1 class="section">Image</h1>
  636. <a id="toc42" name="toc42"></a>
  637. <h2>Syntax: Image name inside brackets: [img]</h2>
  638. <p>
  639. <img align="middle" src="../img/t2tpowered.png" border="0" alt=""/>
  640. </p>
  641. <a id="toc43" name="toc43"></a>
  642. <h2>Syntax: Image pointing to a link: [[img] link]</h2>
  643. <p>
  644. <a href="http://txt2tags.org"><img align="middle" src="../img/t2tpowered.png" border="0" alt=""/></a><br />
  645. </p>
  646. <a id="toc44" name="toc44"></a>
  647. <h2>Align: Image position is preserved when inside paragraph</h2>
  648. <p>
  649. <img align="left" src="../img/t2tpowered.png" border="0" alt=""/> Image at the line beginning.
  650. </p>
  651. <p>
  652. Image in the middle <img align="middle" src="../img/t2tpowered.png" border="0" alt=""/> of the line.
  653. </p>
  654. <p>
  655. Image at the line end. <img align="right" src="../img/t2tpowered.png" border="0" alt=""/>
  656. </p>
  657. <a id="toc45" name="toc45"></a>
  658. <h2>Align: Image alone with spaces around is aligned</h2>
  659. <p>
  660. <img align="left" src="../img/t2tpowered.png" border="0" alt=""/>
  661. <center><img align="middle" src="../img/t2tpowered.png" border="0" alt=""/></center>
  662. <img align="right" src="../img/t2tpowered.png" border="0" alt=""/>
  663. </p>
  664. <a id="toc46" name="toc46"></a>
  665. <h2>Test: Two glued images with no spaces (left &amp; right)</h2>
  666. <p>
  667. <img align="left" src="../img/t2tpowered.png" border="0" alt=""/><img align="right" src="../img/t2tpowered.png" border="0" alt=""/>
  668. </p>
  669. <a id="toc47" name="toc47"></a>
  670. <h2>Test: Various per line</h2>
  671. <p>
  672. Images <img align="middle" src="../img/t2tpowered.png" border="0" alt=""/> mixed <img align="middle" src="../img/t2tpowered.png" border="0" alt=""/> with <img align="middle" src="../img/t2tpowered.png" border="0" alt=""/> text.
  673. </p>
  674. <p>
  675. Images glued together: <img align="middle" src="../img/t2tpowered.png" border="0" alt=""/><img align="middle" src="../img/t2tpowered.png" border="0" alt=""/><img align="middle" src="../img/t2tpowered.png" border="0" alt=""/>.
  676. </p>
  677. <a id="toc48" name="toc48"></a>
  678. <h2>Invalid: Spaces inside are not allowed</h2>
  679. <p>
  680. [../img/t2tpowered.png ]
  681. </p>
  682. <p>
  683. [ ../img/t2tpowered.png]
  684. </p>
  685. <p>
  686. [ ../img/t2tpowered.png ]
  687. </p>
  688. <a id="macro" name="macro"></a>
  689. <h1 class="section">Macro</h1>
  690. <a id="toc50" name="toc50"></a>
  691. <h2>Syntax: Macro without formatting string</h2>
  692. <p>
  693. Date : 20081027 - 20081027<br />
  694. Mtime : 20081027 - 20081027<br />
  695. Infile : rules.t2t - rules.t2t<br />
  696. Outfile : rules.html - rules.html<br />
  697. </p>
  698. <a id="toc51" name="toc51"></a>
  699. <h2>Syntax: Macro name is case insensitive</h2>
  700. <p>
  701. Date : 20081027<br />
  702. Mtime : 20081027<br />
  703. Infile : rules.t2t<br />
  704. Outfile : rules.html<br />
  705. </p>
  706. <a id="toc52" name="toc52"></a>
  707. <h2>Syntax: Macro with formatting string</h2>
  708. <p>
  709. Date : txt 20 txt<br />
  710. Mtime : txt 20 txt<br />
  711. Infile : txt t2t txt<br />
  712. Outfile : txt html txt<br />
  713. </p>
  714. <a id="toc53" name="toc53"></a>
  715. <h2>Syntax: Leading and trailing spaces are preserved</h2>
  716. <p>
  717. Date : ( txt ) - ( 20 )<br />
  718. Mtime : ( txt ) - ( 20 )<br />
  719. Infile : ( txt ) - ( t2t )<br />
  720. Outfile : ( txt ) - ( html )<br />
  721. </p>
  722. <a id="toc54" name="toc54"></a>
  723. <h2>Test: Expansion of the percent char</h2>
  724. <p>
  725. Date : % - % - %% - %%<br />
  726. Mtime : % - % - %% - %%<br />
  727. Infile : % - % - %% - %%<br />
  728. Outfile : % - % - %% - %%<br />
  729. </p>
  730. <a id="toc55" name="toc55"></a>
  731. <h2>Test: Various per line, glued</h2>
  732. <p>
  733. Date : 202008102720081027<br />
  734. Mtime : 202008102720081027<br />
  735. Infile : t2trules.t2trules.t2t<br />
  736. Outfile : htmlrules.htmlrules.html<br />
  737. </p>
  738. <a id="toc56" name="toc56"></a>
  739. <h2>Test: Path formatters</h2>
  740. <p>
  741. Path : /a/pessoal/sourceforge.net/txt2tags/src/doc/English/rules/rules.t2t<br />
  742. Path : /a/pessoal/sourceforge.net/txt2tags/src/doc/English/rules.html<br />
  743. Dirname : /a/pessoal/sourceforge.net/txt2tags/src/doc/English/rules, rules<br />
  744. Dirname : /a/pessoal/sourceforge.net/txt2tags/src/doc/English, English<br />
  745. File : rules + t2t = rules.t2t<br />
  746. File : rules + html = rules.html<br />
  747. </p>
  748. <a id="numtitle" name="numtitle"></a>
  749. <h1 class="section">Numbered Title</h1>
  750. <p>
  751. See <a href="#title">Title</a>, the same rules apply.
  752. </p>
  753. <a id="title" name="title"></a>
  754. <h1 class="section">Title</h1>
  755. <a id="toc59" name="toc59"></a>
  756. <h2>Syntax: Balanced equal signs (from 1 to 5)</h2>
  757. <a id="toc60" name="toc60"></a>
  758. <h1>Title Level 1</h1>
  759. <a id="toc61" name="toc61"></a>
  760. <h2>Title Level 2</h2>
  761. <h3>Title Level 3</h3>
  762. <h4>Title Level 4</h4>
  763. <h5>Title Level 5</h5>
  764. <a id="toc62" name="toc62"></a>
  765. <h2>Label: Between brackets, alphanumeric [A-Za-z0-9_-]</h2>
  766. <a id="lab_el-1" name="lab_el-1"></a>
  767. <h1>Title Level 1</h1>
  768. <a id="lab_el-2" name="lab_el-2"></a>
  769. <h2>Title Level 2</h2>
  770. <a id="lab_el-3" name="lab_el-3"></a>
  771. <h3>Title Level 3</h3>
  772. <a id="lab_el-4" name="lab_el-4"></a>
  773. <h4>Title Level 4</h4>
  774. <a id="lab_el-5" name="lab_el-5"></a>
  775. <h5>Title Level 5</h5>
  776. <a id="toc65" name="toc65"></a>
  777. <h2>Syntax: Spaces around and/or inside are allowed (and ignored)</h2>
  778. <h3>Title Level 3</h3>
  779. <h3>Title Level 3</h3>
  780. <h3>Title Level 3</h3>
  781. <h3>Title Level 3</h3>
  782. <h3>Title Level 3</h3>
  783. <a id="lab_el-9" name="lab_el-9"></a>
  784. <h3>Title Level 3</h3>
  785. <a id="toc66" name="toc66"></a>
  786. <h2>Invalid: Unbalanced equal signs</h2>
  787. <p>
  788. =Not Title
  789. </p>
  790. <p>
  791. ==Not Title=
  792. </p>
  793. <p>
  794. ===Not Title====
  795. </p>
  796. <a id="toc67" name="toc67"></a>
  797. <h2>Invalid: Level deeper than 5</h2>
  798. <p>
  799. ======Not Title 6======
  800. </p>
  801. <p>
  802. =======Not Title 7=======
  803. </p>
  804. <a id="toc68" name="toc68"></a>
  805. <h2>Invalid: Space between title and label</h2>
  806. <p>
  807. =Not Title= [label1]
  808. </p>
  809. <a id="toc69" name="toc69"></a>
  810. <h2>Invalid: Space inside label</h2>
  811. <p>
  812. =Not Title=[ label ]
  813. </p>
  814. <a id="toc70" name="toc70"></a>
  815. <h2>Invalid: Strange chars inside label</h2>
  816. <p>
  817. =Not Title=[la/bel]
  818. </p>
  819. <a id="quote" name="quote"></a>
  820. <h1 class="section">Quote</h1>
  821. <a id="toc72" name="toc72"></a>
  822. <h2>Syntax: TAB defines quote</h2>
  823. <blockquote>
  824. To quote a paragraph, just prefix it by a TAB
  825. character. All the lines of the paragraph must
  826. begin with a TAB.
  827. </blockquote>
  828. <p>
  829. Any non-tabbed line closes the quote block.
  830. </p>
  831. <a id="toc73" name="toc73"></a>
  832. <h2>Nesting: Creating deeper quotes</h2>
  833. <blockquote>
  834. The number of leading TABs identifies the quote
  835. block depth. This is quote level 1.
  836. <blockquote>
  837. With two TABs, we are on the quote
  838. level 2.
  839. <blockquote>
  840. The more TABs, more deep is
  841. the quote level.
  842. <blockquote>
  843. There isn't a limit.
  844. </blockquote>
  845. </blockquote>
  846. </blockquote>
  847. </blockquote>
  848. <p></p>
  849. <a id="toc74" name="toc74"></a>
  850. <h2>Nesting: Reverse nesting works</h2>
  851. <blockquote>
  852. <blockquote>
  853. <blockquote>
  854. <blockquote>
  855. This quote starts at
  856. level 4.
  857. </blockquote>
  858. Then its depth is decreased.
  859. </blockquote>
  860. Counting down, one by one.
  861. </blockquote>
  862. Until the level 1.
  863. </blockquote>
  864. <p></p>
  865. <a id="toc75" name="toc75"></a>
  866. <h2>Nesting: Random count</h2>
  867. <blockquote>
  868. <blockquote>
  869. <blockquote>
  870. Unlike lists, any quote block is
  871. independent, not part of a tree.
  872. </blockquote>
  873. </blockquote>
  874. The TAB count don't need to be incremental
  875. by one.
  876. <blockquote>
  877. <blockquote>
  878. <blockquote>
  879. The nesting don't need
  880. to follow any rule.
  881. </blockquote>
  882. </blockquote>
  883. Quotes can be opened and closed
  884. in any way.
  885. <blockquote>
  886. <blockquote>
  887. <blockquote>
  888. You choose.
  889. </blockquote>
  890. </blockquote>
  891. </blockquote>
  892. </blockquote>
  893. </blockquote>
  894. <p></p>
  895. <a id="toc76" name="toc76"></a>
  896. <h2>Nesting: When not supported</h2>
  897. <blockquote>
  898. Some targets (as sgml) don't support the
  899. nesting of quotes. There is only one quote
  900. level.
  901. <blockquote>
  902. In this case, no matter how much
  903. TABs are used to define the quote
  904. block, it always will be level 1.
  905. </blockquote>
  906. </blockquote>
  907. <p></p>
  908. <a id="toc77" name="toc77"></a>
  909. <h2>Syntax: Spaces after TAB</h2>
  910. <blockquote>
  911. Spaces AFTER the TAB character are allowed.
  912. But be careful, it can be confusing.
  913. </blockquote>
  914. <p></p>
  915. <a id="toc78" name="toc78"></a>
  916. <h2>Invalid: Spaces before TAB</h2>
  917. <p>
  918. Spaces BEFORE the TAB character
  919. invalidate the mark. It's not quote.
  920. </p>
  921. <a id="toc79" name="toc79"></a>
  922. <h2>Invalid: Paragraphs inside</h2>
  923. <blockquote>
  924. Paragraph breaks inside a quote aren't
  925. possible.
  926. </blockquote>
  927. <p></p>
  928. <blockquote>
  929. This sample are two separated quoted
  930. paragraphs, not a quote block with
  931. two paragraphs inside.
  932. </blockquote>
  933. <p></p>
  934. <a id="toc80" name="toc80"></a>
  935. <h2>Closing: EOF closes the open block</h2>
  936. <blockquote>
  937. The end of the file (EOF) closes the
  938. currently open quote block.
  939. </blockquote>
  940. <p></p>
  941. <a id="raw" name="raw"></a>
  942. <h1 class="section">Raw</h1>
  943. <p>
  944. See <a href="#verbatim">Verbatim</a>, the same rules apply.
  945. </p>
  946. <a id="tagged" name="tagged"></a>
  947. <h1 class="section">Tagged</h1>
  948. <p>
  949. See <a href="#verbatim">Verbatim</a>, the same rules apply.
  950. </p>
  951. <a id="verbatim" name="verbatim"></a>
  952. <h1 class="section">Verbatim</h1>
  953. <a id="toc84" name="toc84"></a>
  954. <h2>Syntax: A single line</h2>
  955. <pre>
  956. A verbatim line.
  957. </pre>
  958. <p></p>
  959. <a id="toc85" name="toc85"></a>
  960. <h2>Syntax: A single line with leading spaces</h2>
  961. <pre>
  962. Another verbatim line, with leading spaces.
  963. </pre>
  964. <p></p>
  965. <a id="toc86" name="toc86"></a>
  966. <h2>Syntax: Area (block)</h2>
  967. <pre>
  968. A verbatim area delimited
  969. by lines with marks.
  970. </pre>
  971. <p></p>
  972. <a id="toc87" name="toc87"></a>
  973. <h2>Syntax: Area (block) with trailing spaces</h2>
  974. <pre>
  975. Trailing spaces and TABs after the area marks
  976. are allowed, but not encouraged nor documented.
  977. </pre>
  978. <p></p>
  979. <a id="toc88" name="toc88"></a>
  980. <h2>Invalid: No space between mark and contents</h2>
  981. <p>
  982. ```Not a verbatim line, need one space after mark.
  983. </p>
  984. <a id="toc89" name="toc89"></a>
  985. <h2>Invalid: Leading spaces on block marks</h2>
  986. <p>
  987. ```
  988. Not a verbatim area.
  989. The marks must be at the line beginning,
  990. no leading spaces.
  991. ```
  992. </p>
  993. <a id="toc90" name="toc90"></a>
  994. <h2>Closing: EOF closes the open block</h2>
  995. <pre>
  996. The end of the file (EOF) closes
  997. the currently open verbatim area.
  998. </pre>
  999. <p></p>
  1000. <a id="deflist" name="deflist"></a>
  1001. <h1 class="section">Definition List</h1>
  1002. <p>
  1003. See <a href="#list">List</a>, the same rules apply.
  1004. </p>
  1005. <a id="numlist" name="numlist"></a>
  1006. <h1 class="section">Numbered List</h1>
  1007. <p>
  1008. See <a href="#list">List</a>, the same rules apply.
  1009. </p>
  1010. <a id="list" name="list"></a>
  1011. <h1 class="section">List</h1>
  1012. <a id="toc94" name="toc94"></a>
  1013. <h2>Items: Prefixed by hyphen</h2>
  1014. <ul>
  1015. <li>Use the hyphen to prefix list items.
  1016. </li>
  1017. <li>There must be one space after the hyphen.
  1018. </li>
  1019. <li>The list is closed by two consecutive blank lines.
  1020. </li>
  1021. </ul>
  1022. <a id="toc95" name="toc95"></a>
  1023. <h2>Items: Free leading spacing (indentation)</h2>
  1024. <ul>
  1025. <li>The list can be indented on the source document.
  1026. </li>
  1027. <li>You can use any number of spaces.
  1028. </li>
  1029. <li>The result will be the same.
  1030. </li>
  1031. </ul>
  1032. <a id="toc96" name="toc96"></a>
  1033. <h2>Items: Vertical spacing between items</h2>
  1034. <ul>
  1035. <li>Let one blank line between the list items.
  1036. <p></p>
  1037. </li>
  1038. <li>It will be maintained on the conversion.
  1039. <p></p>
  1040. </li>
  1041. <li>Some targets don't support this behavior.
  1042. <p></p>
  1043. </li>
  1044. <li>This one was separated by a line with blanks.
  1045. You can also put a blank line inside
  1046. <p></p>
  1047. the item contents and it will be preserved.
  1048. </li>
  1049. </ul>
  1050. <a id="toc97" name="toc97"></a>
  1051. <h2>Items: Exactly ONE space after the hyphen</h2>
  1052. <p>
  1053. -This is not a list (no space)
  1054. </p>
  1055. <p>
  1056. - This is not a list (more than one space)
  1057. </p>
  1058. <p>
  1059. - This is not a list (a TAB instead the space)
  1060. </p>
  1061. <a id="toc98" name="toc98"></a>
  1062. <h2>Items: Catchy cases</h2>
  1063. <ul>
  1064. <li>- This is a list
  1065. </li>
  1066. <li>+ This is a list
  1067. </li>
  1068. <li>: This is a list
  1069. </li>
  1070. </ul>
  1071. <a id="toc99" name="toc99"></a>
  1072. <h2>Nesting: Creating sublists</h2>
  1073. <ul>
  1074. <li>This is the "mother" list first item.
  1075. </li>
  1076. <li>Here is the second, but inside this item,
  1077. <ul>
  1078. <li>there is a sublist, with its own items.
  1079. </li>
  1080. <li>Note that the items of the same sublist
  1081. </li>
  1082. <li>must have the same indentation.
  1083. <ul>
  1084. <li>And this can go on, opening sublists.
  1085. <ul>
  1086. <li>Just add leading spaces before the
  1087. </li>
  1088. <li>hyphen and sublists will be opened.
  1089. </li>
  1090. <li>The two blank lines closes them all.
  1091. </li>
  1092. </ul>
  1093. </li>
  1094. </ul>
  1095. </li>
  1096. </ul>
  1097. </li>
  1098. </ul>
  1099. <a id="toc100" name="toc100"></a>
  1100. <h2>Nesting: Free leading spacing (indentation)</h2>
  1101. <ul>
  1102. <li>When nesting lists, the additional spaces are free.
  1103. <ul>
  1104. <li>You can add just one,
  1105. <ul>
  1106. <li>or many.
  1107. <ul>
  1108. <li>What matters is to put more than the previous.
  1109. </li>
  1110. <li>But remember that the other items of the same list
  1111. </li>
  1112. <li>must use the same indentation.
  1113. </li>
  1114. </ul>
  1115. </li>
  1116. </ul>
  1117. </li>
  1118. </ul>
  1119. </li>
  1120. </ul>
  1121. <a id="toc101" name="toc101"></a>
  1122. <h2>Nesting: Maximum depth</h2>
  1123. <ul>
  1124. <li>There is not a depth limit,
  1125. <ul>
  1126. <li>you can go deeper and deeper.
  1127. <ul>
  1128. <li>But some targets may have restrictions.
  1129. <ul>
  1130. <li>The LaTeX maximum is here, 4 levels.
  1131. <ul>
  1132. <li>This one and the following sublists
  1133. <ul>
  1134. <li>are moved up to the level 4
  1135. <ul>
  1136. <li>when converting to LaTeX.
  1137. <ul>
  1138. <li>On the other targets,
  1139. <ul>
  1140. <li>it is just fine
  1141. <ul>
  1142. <li>to have a very deep list.
  1143. </li>
  1144. </ul>
  1145. </li>
  1146. </ul>
  1147. </li>
  1148. </ul>
  1149. </li>
  1150. </ul>
  1151. </li>
  1152. </ul>
  1153. </li>
  1154. </ul>
  1155. </li>
  1156. </ul>
  1157. </li>
  1158. </ul>
  1159. </li>
  1160. </ul>
  1161. </li>
  1162. </ul>
  1163. <a id="toc102" name="toc102"></a>
  1164. <h2>Nesting: Reverse doesn't work</h2>
  1165. <ul>
  1166. <li>Reverse nesting doesn't work.
  1167. </li>
  1168. </ul>
  1169. <ul>
  1170. <li>Because a sublist *must* have a mother list.
  1171. </li>
  1172. </ul>
  1173. <ul>
  1174. <li>It's the list concept, not a txt2tags limitation.
  1175. </li>
  1176. </ul>
  1177. <ul>
  1178. <li>All this sublists will be bumped to mother lists.
  1179. </li>
  1180. </ul>
  1181. <ul>
  1182. <li>At level 1, like this one.
  1183. </li>
  1184. </ul>
  1185. <a id="toc103" name="toc103"></a>
  1186. <h2>Nesting: Going deeper and back</h2>
  1187. <p>
  1188. When nesting back to an upper level, the previous sublist
  1189. is automatically closed.
  1190. </p>
  1191. <ul>
  1192. <li>Level 1
  1193. <ul>
  1194. <li>Level 2
  1195. <ul>
  1196. <li>Level 3
  1197. <ul>
  1198. <li>Level 4
  1199. </li>
  1200. </ul>
  1201. </li>
  1202. <li>Level 3 -- (closed Level 4)
  1203. </li>
  1204. </ul>
  1205. </li>
  1206. <li>Level 2 -- (closed Level 3)
  1207. </li>
  1208. </ul>
  1209. </li>
  1210. <li>Level 1 -- (closed Level 2)
  1211. </li>
  1212. </ul>
  1213. <p>
  1214. More than one list can be closed when nesting back.
  1215. </p>
  1216. <ul>
  1217. <li>Level 1
  1218. <ul>
  1219. <li>Level 2
  1220. <ul>
  1221. <li>Level 3
  1222. <ul>
  1223. <li>Level 4
  1224. </li>
  1225. </ul>
  1226. </li>
  1227. </ul>
  1228. </li>
  1229. </ul>
  1230. </li>
  1231. <li>Level 1 -- (closed Level 4, Level 3 and Level 2)
  1232. </li>
  1233. </ul>
  1234. <a id="toc104" name="toc104"></a>
  1235. <h2>Nesting: Vertical spacing between lists</h2>
  1236. <ul>
  1237. <li>Level 1
  1238. <p></p>
  1239. <ul>
  1240. <li>Level 2 -- blank BEFORE and AFTER (in)
  1241. <p></p>
  1242. <ul>
  1243. <li>Level 3
  1244. <ul>
  1245. <li>Level 4
  1246. </li>
  1247. </ul>
  1248. </li>
  1249. <li>Level 3
  1250. <p></p>
  1251. </li>
  1252. </ul>
  1253. </li>
  1254. <li>Level 2 -- blank BEFORE and AFTER (out)
  1255. <p></p>
  1256. </li>
  1257. </ul>
  1258. </li>
  1259. <li>Level 1
  1260. <p></p>
  1261. <ul>
  1262. <li>Level 2 -- blank BEFORE (spaces) and AFTER (TAB)
  1263. <p></p>
  1264. <ul>
  1265. <li>Level 3
  1266. </li>
  1267. </ul>
  1268. </li>
  1269. </ul>
  1270. </li>
  1271. </ul>
  1272. <a id="toc105" name="toc105"></a>
  1273. <h2>Nesting: Messing up</h2>
  1274. <p>
  1275. Be careful when going back on the nesting,
  1276. it must be on a valid level! If not, it will
  1277. be bumped up to the previous valid level.
  1278. </p>
  1279. <ul>
  1280. <li>Level 1
  1281. <ul>
  1282. <li>Level 2
  1283. <ul>
  1284. <li>Level 3
  1285. <ul>
  1286. <li>Level 4
  1287. </li>
  1288. </ul>
  1289. </li>
  1290. <li>Level 3.5 ???
  1291. </li>
  1292. <li>Level 3
  1293. </li>
  1294. </ul>
  1295. </li>
  1296. <li>Level 2.5 ???
  1297. </li>
  1298. <li>Level 2
  1299. </li>
  1300. </ul>
  1301. </li>
  1302. <li>Level 1.5 ???
  1303. </li>
  1304. <li>Level 1
  1305. </li>
  1306. </ul>
  1307. <a id="toc106" name="toc106"></a>
  1308. <h2>Closing: Two (not so) empty lines</h2>
  1309. <ul>
  1310. <li>This list is closed by a line with spaces and other with TABs
  1311. </li>
  1312. </ul>
  1313. <ul>
  1314. <li>This list is NOT closed by two comment lines
  1315. </li>
  1316. <li>This list is closed by a line with spaces and TAB,
  1317. </li>
  1318. <li>then a comment line, then an empty line.
  1319. </li>
  1320. </ul>
  1321. <a id="toc107" name="toc107"></a>
  1322. <h2>Closing: Empty item closes current (sub)list</h2>
  1323. <p>
  1324. The two blank lines closes ALL the lists.
  1325. To close just the current, use an empty item.
  1326. </p>
  1327. <ul>
  1328. <li>Level 1
  1329. <ul>
  1330. <li>Level 2
  1331. <ul>
  1332. <li>Level 3
  1333. </li>
  1334. </ul>
  1335. Level 2
  1336. </li>
  1337. </ul>
  1338. Level 1
  1339. </li>
  1340. </ul>
  1341. <p></p>
  1342. <p>
  1343. The empty item can have trailing blanks.
  1344. </p>
  1345. <ul>
  1346. <li>Empty item with trailing spaces.
  1347. </li>
  1348. </ul>
  1349. <p></p>
  1350. <ul>
  1351. <li>Empty item with trailing TAB.
  1352. </li>
  1353. </ul>
  1354. <p></p>
  1355. <a id="toc108" name="toc108"></a>
  1356. <h2>Closing: EOF closes the lists</h2>
  1357. <ul>
  1358. <li>If the end of the file (EOF) is hit,
  1359. <ul>
  1360. <li>all the currently opened list are closed,
  1361. <ul>
  1362. <li>just like when using the two blank lines.
  1363. </li>
  1364. </ul>
  1365. </li>
  1366. </ul>
  1367. </li>
  1368. </ul>
  1369. <a id="table" name="table"></a>
  1370. <h1 class="section">Table</h1>
  1371. <a id="toc110" name="toc110"></a>
  1372. <h2>Syntax: Lines starting with a pipe |</h2>
  1373. <table>
  1374. <tr>
  1375. <td>Cell 1</td>
  1376. </tr>
  1377. </table>
  1378. <a id="toc111" name="toc111"></a>
  1379. <h2>Syntax: Extra pipes separate cells</h2>
  1380. <table>
  1381. <tr>
  1382. <td>Cell 1</td>
  1383. <td>Cell 2</td>
  1384. <td>Cell 3</td>
  1385. </tr>
  1386. </table>
  1387. <a id="toc112" name="toc112"></a>
  1388. <h2>Syntax: With a trailing pipe, make border</h2>
  1389. <table border="1">
  1390. <tr>
  1391. <td>Cell 1</td>
  1392. <td>Cell 2</td>
  1393. <td>Cell 3</td>
  1394. </tr>
  1395. </table>
  1396. <a id="toc113" name="toc113"></a>
  1397. <h2>Syntax: Table lines starting with double pipe are heading</h2>
  1398. <table border="1">
  1399. <tr>
  1400. <th>Cell 1</th>
  1401. <th>Cell 2</th>
  1402. <th>Cell 3</th>
  1403. </tr>
  1404. </table>
  1405. <a id="toc114" name="toc114"></a>
  1406. <h2>Align: Spaces before the leading pipe centralize the table</h2>
  1407. <table align="center" border="1">
  1408. <tr>
  1409. <td>Cell 1</td>
  1410. <td>Cell 2</td>
  1411. <td>Cell 3</td>
  1412. </tr>
  1413. </table>
  1414. <a id="toc115" name="toc115"></a>
  1415. <h2>Align: Spaces inside the cell denote its alignment</h2>
  1416. <table align="center" border="1">
  1417. <tr>
  1418. <th>Heading</th>
  1419. <th>Heading</th>
  1420. <th>Heading</th>
  1421. </tr>
  1422. <tr>
  1423. <td>&lt;-</td>
  1424. <td align="center">--</td>
  1425. <td align="right">-&gt;</td>
  1426. </tr>
  1427. <tr>
  1428. <td align="center">--</td>
  1429. <td align="center">--</td>
  1430. <td align="center">--</td>
  1431. </tr>
  1432. <tr>
  1433. <td align="right">-&gt;</td>
  1434. <td align="center">--</td>
  1435. <td>&lt;-</td>
  1436. </tr>
  1437. </table>
  1438. <a id="toc116" name="toc116"></a>
  1439. <h2>Span: Column span is defined by extra pipes at cell closing</h2>
  1440. <table align="center" border="1">
  1441. <tr>
  1442. <th>1</th>
  1443. <th>2</th>
  1444. <th colspan="2">3+4</th>
  1445. </tr>
  1446. <tr>
  1447. <td align="center">1</td>
  1448. <td align="center">2</td>
  1449. <td align="center">3</td>
  1450. <td align="center">4</td>
  1451. </tr>
  1452. <tr>
  1453. <td align="center" colspan="3">1+2+3</td>
  1454. <td align="center">4</td>
  1455. </tr>
  1456. <tr>
  1457. <td align="center">1</td>
  1458. <td align="center" colspan="2">2+3</td>
  1459. <td align="center">4</td>
  1460. </tr>
  1461. <tr>
  1462. <td align="center" colspan="4">1+2+3+4</td>
  1463. </tr>
  1464. </table>
  1465. <a id="toc117" name="toc117"></a>
  1466. <h2>Test: Empty cells are placed as expected</h2>
  1467. <table align="center" border="1">
  1468. <tr>
  1469. <td>0</td>
  1470. <td>1</td>
  1471. <td>2</td>
  1472. <td></td>
  1473. </tr>
  1474. <tr>
  1475. <td>4</td>
  1476. <td>5</td>
  1477. <td></td>
  1478. <td>7</td>
  1479. </tr>
  1480. <tr>
  1481. <td>8</td>
  1482. <td></td>
  1483. <td>A</td>
  1484. <td>B</td>
  1485. </tr>
  1486. <tr>
  1487. <td></td>
  1488. <td>D</td>
  1489. <td>E</td>
  1490. <td>F</td>
  1491. </tr>
  1492. </table>
  1493. <a id="toc118" name="toc118"></a>
  1494. <h2>Test: Lines with different number of cells</h2>
  1495. <table align="center" border="1">
  1496. <tr>
  1497. <td>1</td>
  1498. </tr>
  1499. <tr>
  1500. <td>1</td>
  1501. <td>2</td>
  1502. </tr>
  1503. <tr>
  1504. <td>1</td>
  1505. <td>2</td>
  1506. <td>3</td>
  1507. </tr>
  1508. <tr>
  1509. <td>1</td>
  1510. <td>2</td>
  1511. <td>3</td>
  1512. <td>4</td>
  1513. </tr>
  1514. <tr>
  1515. <td>1</td>
  1516. <td>2</td>
  1517. <td>3</td>
  1518. <td>4</td>
  1519. <td>5</td>
  1520. </tr>
  1521. </table>
  1522. <a id="toc119" name="toc119"></a>
  1523. <h2>Test: Empty cells + Span + Messy cell number = Fun!</h2>
  1524. <table align="center" border="1">
  1525. <tr>
  1526. <td align="right">Jan</td>
  1527. </tr>
  1528. <tr>
  1529. <td align="right" colspan="2">Fev</td>
  1530. </tr>
  1531. <tr>
  1532. <td align="right" colspan="3">Mar</td>
  1533. </tr>
  1534. <tr>
  1535. <td align="right" colspan="4">Apr</td>
  1536. </tr>
  1537. <tr>
  1538. <td align="right" colspan="5">May</td>
  1539. </tr>
  1540. <tr>
  1541. <td align="center">20%</td>
  1542. <td align="center">40%</td>
  1543. <td align="center">60%</td>
  1544. <td align="center">80%</td>
  1545. <td align="center">100%</td>
  1546. </tr>
  1547. </table>
  1548. <table align="center" border="1">
  1549. <tr>
  1550. <td></td>
  1551. <td></td>
  1552. <td align="center">/</td>
  1553. <td></td>
  1554. <td></td>
  1555. </tr>
  1556. <tr>
  1557. <td></td>
  1558. <td align="center" colspan="3">/ / / / /</td>
  1559. <td></td>
  1560. </tr>
  1561. <tr>
  1562. <td align="center" colspan="5">/ / / / / / / / /</td>
  1563. </tr>
  1564. <tr>
  1565. <td></td>
  1566. <td align="center">o</td>
  1567. <td></td>
  1568. <td align="center">o</td>
  1569. <td></td>
  1570. </tr>
  1571. <tr>
  1572. <td></td>
  1573. <td></td>
  1574. <td align="right">.</td>
  1575. <td></td>
  1576. <td></td>
  1577. </tr>
  1578. <tr>
  1579. <td></td>
  1580. <td align="center" colspan="3">= = = =</td>
  1581. <td></td>
  1582. </tr>
  1583. </table>
  1584. <table align="center" border="1">
  1585. <tr>
  1586. <td>01</td>
  1587. <td>02</td>
  1588. <td></td>
  1589. <td></td>
  1590. <td>05</td>
  1591. <td></td>
  1592. <td>07</td>
  1593. <td></td>
  1594. </tr>
  1595. <tr>
  1596. <td></td>
  1597. <td></td>
  1598. <td>11</td>
  1599. <td></td>
  1600. <td>13</td>
  1601. <td></td>
  1602. <td></td>
  1603. <td>16</td>
  1604. </tr>
  1605. <tr>
  1606. <td>17</td>
  1607. <td></td>
  1608. <td>19</td>
  1609. <td>20</td>
  1610. <td></td>
  1611. <td></td>
  1612. <td>23</td>
  1613. <td></td>
  1614. </tr>
  1615. <tr>
  1616. <td>25</td>
  1617. <td>26</td>
  1618. <td></td>
  1619. <td></td>
  1620. <td>29</td>
  1621. <td>30</td>
  1622. <td></td>
  1623. <td>32</td>
  1624. </tr>
  1625. <tr>
  1626. <td></td>
  1627. <td></td>
  1628. <td>35</td>
  1629. <td></td>
  1630. <td>37</td>
  1631. <td></td>
  1632. <td>39</td>
  1633. <td>40</td>
  1634. </tr>
  1635. </table>
  1636. <a id="toc120" name="toc120"></a>
  1637. <h2>Test: Lots of cells at the same line</h2>
  1638. <table border="1">
  1639. <tr>
  1640. <td>0</td>
  1641. <td>1</td>
  1642. <td>2</td>
  1643. <td>3</td>
  1644. <td>4</td>
  1645. <td>5</td>
  1646. <td>6</td>
  1647. <td>7</td>
  1648. <td>8</td>
  1649. <td>9</td>
  1650. <td>A</td>
  1651. <td>B</td>
  1652. <td>C</td>
  1653. <td>D</td>
  1654. <td>E</td>
  1655. <td>F</td>
  1656. <td>0</td>
  1657. <td>1</td>
  1658. <td>2</td>
  1659. <td>3</td>
  1660. <td>4</td>
  1661. <td>5</td>
  1662. <td>6</td>
  1663. <td>7</td>
  1664. <td>8</td>
  1665. <td>9</td>
  1666. <td>A</td>
  1667. <td>B</td>
  1668. <td>C</td>
  1669. <td>D</td>
  1670. <td>E</td>
  1671. <td>F</td>
  1672. </tr>
  1673. </table>
  1674. <a id="toc121" name="toc121"></a>
  1675. <h2>Test: Empty lines</h2>
  1676. <table border="1">
  1677. <tr>
  1678. <td></td>
  1679. </tr>
  1680. <tr>
  1681. <td></td>
  1682. </tr>
  1683. <tr>
  1684. <td></td>
  1685. </tr>
  1686. </table>
  1687. <a id="toc122" name="toc122"></a>
  1688. <h2>Invalid: There must be at least one space around the pipe</h2>
  1689. <p>
  1690. |this|is|not|a|table|
  1691. </p>
  1692. <p>
  1693. |this| is| not| a| table|
  1694. </p>
  1695. <p>
  1696. |this |is |not |a |table |
  1697. </p>
  1698. <a id="toc123" name="toc123"></a>
  1699. <h2>Invalid: You must use spaces, not TABs</h2>
  1700. <p>
  1701. | this | is | not | a | table |
  1702. </p>
  1703. <hr class="light" />
  1704. <p></p>
  1705. <p>
  1706. The End.
  1707. </p>
  1708. </div>
  1709. <!-- xhtml code generated by txt2tags (http://txt2tags.org) -->
  1710. <!-- cmdline: txt2tags /a/pessoal/sourceforge.net/txt2tags/src/doc/English/rules/rules.t2t -->
  1711. </body></html>