/samples/extra/sample.mgp

http://txt2tags.googlecode.com/ · Unknown · 399 lines · 287 code · 112 blank · 0 comment · 0 complexity · 6d7721ba0f339b3867f2381b3c06694a MD5 · raw file

  1. #!/usr/X11R6/bin/mgp -t 90
  2. %deffont "normal" xfont "utopia-medium-r", charset "iso8859-1"
  3. %deffont "normal-i" xfont "utopia-medium-i", charset "iso8859-1"
  4. %deffont "normal-b" xfont "utopia-bold-r" , charset "iso8859-1"
  5. %deffont "normal-bi" xfont "utopia-bold-i" , charset "iso8859-1"
  6. %deffont "mono" xfont "courier-medium-r", charset "iso8859-1"
  7. %default 1 size 5
  8. %default 2 size 8, fore "yellow", font "normal-b", center
  9. %default 3 size 5, fore "white", font "normal", left, prefix " "
  10. %tab 1 size 4, vgap 30, prefix " ", icon arc "red" 40, leftfill
  11. %tab 2 prefix " ", icon arc "orange" 40, leftfill
  12. %tab 3 prefix " ", icon arc "brown" 40, leftfill
  13. %tab 4 prefix " ", icon arc "darkmagenta" 40, leftfill
  14. %tab 5 prefix " ", icon arc "magenta" 40, leftfill
  15. %%------------------------- end of headers -----------------------------
  16. %page
  17. %size 10, center, fore "yellow"
  18. TXT2TAGS SAMPLE
  19. %font "normal-i", size 6, fore "white", center
  20. Aurelio Jargas
  21. %font "mono", size 7, center
  22. 07/10/2011
  23. %font "normal", size 5
  24. This text is before the introduction.
  25. %font "normal", size 5
  26. But it's OK.
  27. %page
  28. Introduction
  29. %font "normal", size 5
  30. Welcome to the txt2tags sample file.
  31. %font "normal", size 5
  32. Here you have examples and a brief explanation of all
  33. marks.
  34. %font "normal", size 5
  35. The first 3 lines of the this file are used as headers,
  36. on the following format:
  37. %font "mono"
  38. line1: document title
  39. line2: author name, email
  40. line3: date, version
  41. %font "normal"
  42. %font "normal", size 5
  43. Lines with balanced equal signs = around are titles.
  44. %page
  45. Fonts and Beautifiers
  46. %font "normal", size 5
  47. We have two sets of fonts:
  48. %font "normal", size 5
  49. The NORMAL type that can be improved with beautifiers.
  50. %font "normal", size 5
  51. The TYPEWRITER type that uses monospaced font for
  52. pre-formatted text.
  53. %font "normal", size 5
  54. We will now enter on a subtitle...
  55. %page
  56. Beautifiers
  57. %font "normal", size 5
  58. The text marks for beautifiers are simple, just as you
  59. type on a plain text email message.
  60. %font "normal", size 5
  61. We use double *, /, - and _ to represent
  62. %cont, font "normal-b"
  63. bold
  64. %cont, font "normal"
  65. ,
  66. %cont, font "normal-i"
  67. italic
  68. %cont, font "normal"
  69. , strike and
  70. %cont, fore "cyan"
  71. underline
  72. %cont, fore "white"
  73. .
  74. %font "normal", size 5
  75. The
  76. %cont, font "normal-b"
  77. %cont, font "normal-i"
  78. bold italic
  79. %cont, font "normal"
  80. %cont, font "normal"
  81. style is also supported as a
  82. combination.
  83. %page
  84. Pre-Formatted Text
  85. %font "normal", size 5
  86. We can put a code sample or other pre-formatted text:
  87. %font "mono"
  88. here is pre-formatted
  89. //marks// are **not** ``interpreted``
  90. %font "normal"
  91. %font "normal", size 5
  92. And also, it's easy to put a one line pre-formatted
  93. text:
  94. %font "mono"
  95. prompt$ ls /etc
  96. %font "normal"
  97. %font "normal", size 5
  98. Or use
  99. %cont, font "mono"
  100. pre-formatted
  101. %cont, font "normal"
  102. inside sentences.
  103. %page
  104. More Cosmetics
  105. %font "normal", size 5
  106. Special entities like email (
  107. %cont, fore "cyan"
  108. duh@somewhere.com
  109. %cont, fore "white"
  110. ) and
  111. URL (
  112. %cont, fore "cyan"
  113. http://www.duh.com
  114. %cont, fore "white"
  115. ) are detected automagically,
  116. as long as the horizontal line:
  117. %bar "white" 5
  118. %font "normal", size 5
  119. ^ thin or large v
  120. %pause
  121. %font "normal", size 5
  122. You can also specify an explicit link
  123. %cont, fore "cyan"
  124. http://duh.org
  125. %cont, fore "white"
  126. or an explicit email
  127. %cont, fore "cyan"
  128. duh@somewhere.com
  129. %cont, fore "white"
  130. with label.
  131. %font "normal", size 5
  132. And remember,
  133. %prefix " "
  134. A TAB in front of the line does a quotation.
  135. %prefix " "
  136. More TABs, more depth (if allowed).
  137. %prefix " "
  138. %prefix " "
  139. %font "normal", size 5
  140. Nice.
  141. %page
  142. Lists
  143. %font "normal", size 5
  144. A list of items is natural, just putting a
  145. %cont, font "normal-b"
  146. dash
  147. %cont, font "normal"
  148. or
  149. a
  150. %cont, font "normal-b"
  151. plus
  152. %cont, font "normal"
  153. at the beginning of the line.
  154. %page
  155. Plain List
  156. %font "normal", size 5
  157. The dash is the default list identifier. For sublists,
  158. just add
  159. %cont, font "normal-b"
  160. spaces
  161. %cont, font "normal"
  162. at the beginning of the line. More
  163. spaces, more sublists.
  164. Earth
  165. America
  166. South America
  167. Brazil
  168. How deep can I go?
  169. Europe
  170. Lots of countries
  171. Mars
  172. Who knows?
  173. %font "normal", size 5
  174. The list ends with
  175. %cont, font "normal-b"
  176. two
  177. %cont, font "normal"
  178. consecutive blank lines.
  179. %page
  180. Numbered List
  181. %font "normal", size 5
  182. The same rules as the plain list, just a different
  183. identifier (plus).
  184. 1. one
  185. 2. two
  186. 3. three
  187. mixed lists!
  188. what a mess
  189. 1. counting again
  190. 2. ...
  191. 4. four
  192. %page
  193. Definition List
  194. %font "normal", size 5
  195. The definition list identifier is a colon, followed by
  196. the term. The term contents is placed on the next line.
  197. %cont, font "normal-b"
  198. orange
  199. %cont, font "normal"
  200. a yellow fruit
  201. %cont, font "normal-b"
  202. apple
  203. %cont, font "normal"
  204. a green or red fruit
  205. %cont, font "normal-b"
  206. other fruits
  207. %cont, font "normal"
  208. wee!
  209. mixing lists
  210. 1. again!
  211. 2. and again!
  212. %page
  213. Tables
  214. %font "normal", size 5
  215. Use pipes to compose table rows and cells.
  216. Double pipe at the line beginning starts a heading row.
  217. Natural spaces specify each cell alignment.
  218. %center
  219. %newimage "table_1.png"
  220. %font "normal", size 5
  221. Without the last pipe, no border:
  222. %center
  223. %newimage "table_2.png"
  224. %page
  225. Special Entities
  226. %font "normal", size 5
  227. Because things were too simple.
  228. %page
  229. Images
  230. %font "normal", size 5
  231. The image mark is as simple as it can be:
  232. %cont, font "mono"
  233. [filename]
  234. %cont, font "normal"
  235. .
  236. %font "normal", size 5
  237. %center
  238. %newimage "img/photo.jpg"
  239. %left
  240. %font "normal", size 5
  241. And with some targets the image is linkable :
  242. %font "normal", size 5
  243. (img/photo.jpg)
  244. %cont, fore "cyan"
  245. http://www.txt2tags.org
  246. %cont, fore "white"
  247. The filename must end in PNG, JPG, GIF, or similar.
  248. No spaces inside the brackets!
  249. %page
  250. Other
  251. %font "normal", size 5
  252. When the target needs, special chars like <, > and &
  253. are escaped.
  254. %font "normal", size 5
  255. The handy
  256. %cont, font "mono"
  257. %%date
  258. %cont, font "normal"
  259. macro expands to the current date.
  260. %font "normal", size 5
  261. So today is 20110710 on the ISO
  262. %cont, font "mono"
  263. YYYYMMDD
  264. %cont, font "normal"
  265. format.
  266. %font "normal", size 5
  267. You can also specify the date format with the %? flags,
  268. as
  269. %cont, font "mono"
  270. %%date(%m-%d-%Y)
  271. %cont, font "normal"
  272. which gives: 07-10-2011.
  273. %font "normal", size 5
  274. That's all for now.
  275. %bar "white" 5
  276. %font "normal", size 5
  277. %left
  278. %newimage "img/t2tpowered.png"
  279. %left
  280. (sample.t2t
  281. %cont, fore "cyan"
  282. sample.t2t
  283. %cont, fore "white"
  284. )
  285. %% mgp code generated by txt2tags 2.6.736 (http://txt2tags.org)
  286. %% cmdline: txt2tags -t mgp sample.t2t
  287. %%EOD