/test/marks/table.t2t

http://txt2tags.googlecode.com/ · Unknown · 84 lines · 65 code · 19 blank · 0 comment · 0 complexity · 254343bc3d63b9f7587ab6be8f24e26f MD5 · raw file

  1. %!includeconf: test.conf
  2. BODYINIT
  3. %%% Syntax: Lines starting with a pipe |
  4. | Cell 1
  5. %%% Syntax: Extra pipes separate cells
  6. | Cell 1 | Cell 2 | Cell 3
  7. %%% Syntax: With a trailing pipe, make border
  8. | Cell 1 | Cell 2 | Cell 3 |
  9. %%% Syntax: Table lines starting with double pipe are heading
  10. || Cell 1 | Cell 2 | Cell 3 |
  11. %%% Align: Spaces before the leading pipe centralize the table
  12. | Cell 1 | Cell 2 | Cell 3 |
  13. %%% Align: Spaces inside the cell denote its alignment
  14. || Heading | Heading | Heading |
  15. % comments don't close an opened table
  16. | <- | -- | -> |
  17. | -- | -- | -- |
  18. | -> | -- | <- |
  19. %%% Span: Column span is defined by extra pipes at cell closing
  20. || 1 | 2 | 3+4 ||
  21. | 1 | 2 | 3 | 4 |
  22. | 1+2+3 ||| 4 |
  23. | 1 | 2+3 || 4 |
  24. | 1+2+3+4 ||||
  25. %%% Test: Empty cells are placed as expected
  26. | 0 | 1 | 2 | |
  27. | 4 | 5 | | 7 |
  28. | 8 | | A | B |
  29. | | D | E | F |
  30. %%% Test: Lines with different number of cells
  31. | 1 |
  32. | 1 | 2 |
  33. | 1 | 2 | 3 |
  34. | 1 | 2 | 3 | 4 |
  35. | 1 | 2 | 3 | 4 | 5 |
  36. %%% Test: Empty cells + Span + Messy cell number = Fun!
  37. | Jan |
  38. | Fev ||
  39. | Mar |||
  40. | Apr ||||
  41. | May |||||
  42. | 20% | 40% | 60% | 80% | 100% |
  43. | | | / | | |
  44. | | / / / / / ||| |
  45. | / / / / / / / / / |||||
  46. | | o | | o | |
  47. | | | . | | |
  48. | | = = = = ||| |
  49. | 01 | 02 | | | 05 | | 07 | |
  50. | | | 11 | | 13 | | | 16 |
  51. | 17 | | 19 | 20 | | | 23 | |
  52. | 25 | 26 | | | 29 | 30 | | 32 |
  53. | | | 35 | | 37 | | 39 | 40 |
  54. %%% Test: Lots of cells at the same line
  55. | 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 |
  56. %%% Test: Empty lines
  57. | |
  58. | |
  59. | |
  60. %%% Invalid: There must be at least one space around the pipe
  61. |this|is|not|a|table|
  62. |this| is| not| a| table|
  63. |this |is |not |a |table |
  64. %%% Invalid: You must use spaces, not TABs
  65. | this | is | not | a | table |