PageRenderTime 42ms CodeModel.GetById 33ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

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