/samples/sample.adoc

http://txt2tags.googlecode.com/ · AsciiDoc · 232 lines · 156 code · 76 blank · 0 comment · 0 complexity · 5098d59a125f23c66070483369a7c2d3 MD5 · raw file

  1. = TXT2TAGS SAMPLE
  2. Aurelio Jargas
  3. 02/12/2013
  4. This text is before the introduction.
  5. But it's OK.
  6. == Introduction
  7. Welcome to the txt2tags sample file.
  8. Here you have examples and a brief explanation of all
  9. marks.
  10. The first 3 lines of the this file are used as headers,
  11. on the following format:
  12. ----
  13. line1: document title
  14. line2: author name, email
  15. line3: date, version
  16. ----
  17. Lines with balanced equal signs = around are titles.
  18. == Fonts and Beautifiers
  19. We have two sets of fonts:
  20. The NORMAL type that can be improved with beautifiers.
  21. The TYPEWRITER type that uses monospaced font for
  22. pre-formatted text.
  23. We will now enter on a subtitle...
  24. === Beautifiers
  25. The text marks for beautifiers are simple, just as you
  26. type on a plain text email message.
  27. We use double *, /, - and _ to represent *bold*,
  28. _italic_, strike and underline.
  29. The *_bold italic_* style is also supported as a
  30. combination.
  31. === Pre-Formatted Text
  32. We can put a code sample or other pre-formatted text:
  33. ----
  34. here is pre-formatted
  35. //marks// are **not** ``interpreted``
  36. ----
  37. And also, it's easy to put a one line pre-formatted
  38. text:
  39. ----
  40. prompt$ ls /etc
  41. ----
  42. Or use +pre-formatted+ inside sentences.
  43. === More Cosmetics
  44. Special entities like email (mailto:duh@somewhere.com) and
  45. URL (http://www.duh.com) are detected automagically,
  46. as long as the horizontal line:
  47. ^ thin or large v
  48. You can also specify an http://duh.org[explicit link]
  49. or an mailto:duh@somewhere.com[explicit email] with label.
  50. And remember,
  51. A TAB in front of the line does a quotation.
  52. More TABs, more depth (if allowed).
  53. Nice.
  54. == Lists
  55. A list of items is natural, just putting a *dash* or
  56. a *plus* at the beginning of the line.
  57. === Plain List
  58. The dash is the default list identifier. For sublists,
  59. just add *spaces* at the beginning of the line. More
  60. spaces, more sublists.
  61. * Earth
  62. ** America
  63. *** South America
  64. **** Brazil
  65. ***** How deep can I go?
  66. ** Europe
  67. *** Lots of countries
  68. * Mars
  69. ** Who knows?
  70. The list ends with *two* consecutive blank lines.
  71. === Numbered List
  72. The same rules as the plain list, just a different
  73. identifier (plus).
  74. 1. one
  75. 1. two
  76. 1. three
  77. ** mixed lists!
  78. ** what a mess
  79. 1. counting again
  80. 1. ...
  81. 1. four
  82. === Definition List
  83. The definition list identifier is a colon, followed by
  84. the term. The term contents is placed on the next line.
  85. orange::
  86. a yellow fruit
  87. apple::
  88. a green or red fruit
  89. other fruits::
  90. ** wee!
  91. ** mixing lists
  92. 1. again!
  93. 1. and again!
  94. == Tables
  95. Use pipes to compose table rows and cells.
  96. Double pipe at the line beginning starts a heading row.
  97. Natural spaces specify each cell alignment.
  98. ----
  99. | cell 1.1 | cell 1.2 | cell 1.3 |
  100. | cell 2.1 | cell 2.2 | cell 2.3 |
  101. | cell 3.1 | cell 3.2 | cell 3.3 |
  102. ----
  103. ----
  104. || heading 1 | heading 2 | heading 3 |
  105. | cell 1.1 | cell 1.2 | cell 1.3 |
  106. | cell 2.1 | cell 2.2 | cell 2.3 |
  107. ----
  108. ----
  109. |_ heading 1 | cell 1.1 | cell 1.2 |
  110. | heading 2 | cell 2.1 | cell 2.2 |
  111. | heading 3 | cell 3.1 | cell 3.2 |
  112. ----
  113. ----
  114. |/ heading | heading 1 | heading 2 |
  115. | heading 1 | cell 1.1 | cell 1.2 |
  116. | heading 2 | cell 2.1 | cell 2.2 |
  117. ----
  118. Without the last pipe, no border:
  119. ----
  120. | cell 1.1 | cell 1.2 | cell 1.3
  121. | cell 2.1 | cell 2.2 | cell 2.3
  122. | cell 3.1 | cell 3.2 | cell 3.3
  123. ----
  124. ----
  125. || heading 1 | heading 2 | heading 3
  126. | cell 1.1 | cell 1.2 | cell 1.3
  127. | cell 2.1 | cell 2.2 | cell 2.3
  128. ----
  129. ----
  130. |_ heading 1 | cell 1.1 | cell 1.2
  131. | heading 2 | cell 2.1 | cell 2.2
  132. | heading 3 | cell 3.1 | cell 3.2
  133. ----
  134. ----
  135. |/ heading | heading 1 | heading 2
  136. | heading 1 | cell 1.1 | cell 1.2
  137. | heading 2 | cell 2.1 | cell 2.2
  138. ----
  139. == Special Entities
  140. Because things were too simple.
  141. === Images
  142. The image mark is as simple as it can be: +[filename]+.
  143. image::img/photo.jpg[]
  144. And with some targets the image is linkable :
  145. http://www.txt2tags.org[(img/photo.jpg)]
  146. * The filename must end in PNG, JPG, GIF, or similar.
  147. * No spaces inside the brackets!
  148. === Other
  149. When the target needs, special chars like <, > and &
  150. are escaped.
  151. The handy +%%date+ macro expands to the current date.
  152. So today is 20130213 on the ISO +YYYYMMDD+ format.
  153. You can also specify the date format with the %? flags,
  154. as +%%date(%m-%d-%Y)+ which gives: 02-13-2013.
  155. That's all for now.
  156. image::img/t2tpowered.png[] (sample.t2t[sample.t2t])