/samples/extra/sample.mgp
http://txt2tags.googlecode.com/ · Unknown · 399 lines · 287 code · 112 blank · 0 comment · 0 complexity · 6d7721ba0f339b3867f2381b3c06694a MD5 · raw file
- #!/usr/X11R6/bin/mgp -t 90
- %deffont "normal" xfont "utopia-medium-r", charset "iso8859-1"
- %deffont "normal-i" xfont "utopia-medium-i", charset "iso8859-1"
- %deffont "normal-b" xfont "utopia-bold-r" , charset "iso8859-1"
- %deffont "normal-bi" xfont "utopia-bold-i" , charset "iso8859-1"
- %deffont "mono" xfont "courier-medium-r", charset "iso8859-1"
- %default 1 size 5
- %default 2 size 8, fore "yellow", font "normal-b", center
- %default 3 size 5, fore "white", font "normal", left, prefix " "
- %tab 1 size 4, vgap 30, prefix " ", icon arc "red" 40, leftfill
- %tab 2 prefix " ", icon arc "orange" 40, leftfill
- %tab 3 prefix " ", icon arc "brown" 40, leftfill
- %tab 4 prefix " ", icon arc "darkmagenta" 40, leftfill
- %tab 5 prefix " ", icon arc "magenta" 40, leftfill
- %%------------------------- end of headers -----------------------------
- %page
- %size 10, center, fore "yellow"
- TXT2TAGS SAMPLE
- %font "normal-i", size 6, fore "white", center
- Aurelio Jargas
- %font "mono", size 7, center
- 07/10/2011
- %font "normal", size 5
- This text is before the introduction.
- %font "normal", size 5
- But it's OK.
- %page
- Introduction
- %font "normal", size 5
- Welcome to the txt2tags sample file.
- %font "normal", size 5
- Here you have examples and a brief explanation of all
- marks.
- %font "normal", size 5
- The first 3 lines of the this file are used as headers,
- on the following format:
- %font "mono"
- line1: document title
- line2: author name, email
- line3: date, version
- %font "normal"
- %font "normal", size 5
- Lines with balanced equal signs = around are titles.
- %page
- Fonts and Beautifiers
- %font "normal", size 5
- We have two sets of fonts:
- %font "normal", size 5
- The NORMAL type that can be improved with beautifiers.
- %font "normal", size 5
- The TYPEWRITER type that uses monospaced font for
- pre-formatted text.
- %font "normal", size 5
- We will now enter on a subtitle...
- %page
- Beautifiers
- %font "normal", size 5
- The text marks for beautifiers are simple, just as you
- type on a plain text email message.
- %font "normal", size 5
- We use double *, /, - and _ to represent
- %cont, font "normal-b"
- bold
- %cont, font "normal"
- ,
- %cont, font "normal-i"
- italic
- %cont, font "normal"
- , strike and
- %cont, fore "cyan"
- underline
- %cont, fore "white"
- .
- %font "normal", size 5
- The
- %cont, font "normal-b"
- %cont, font "normal-i"
- bold italic
- %cont, font "normal"
- %cont, font "normal"
- style is also supported as a
- combination.
- %page
- Pre-Formatted Text
- %font "normal", size 5
- We can put a code sample or other pre-formatted text:
- %font "mono"
- here is pre-formatted
- //marks// are **not** ``interpreted``
- %font "normal"
- %font "normal", size 5
- And also, it's easy to put a one line pre-formatted
- text:
- %font "mono"
- prompt$ ls /etc
- %font "normal"
- %font "normal", size 5
- Or use
- %cont, font "mono"
- pre-formatted
- %cont, font "normal"
- inside sentences.
- %page
- More Cosmetics
- %font "normal", size 5
- Special entities like email (
- %cont, fore "cyan"
- duh@somewhere.com
- %cont, fore "white"
- ) and
- URL (
- %cont, fore "cyan"
- http://www.duh.com
- %cont, fore "white"
- ) are detected automagically,
- as long as the horizontal line:
- %bar "white" 5
- %font "normal", size 5
- ^ thin or large v
- %pause
- %font "normal", size 5
- You can also specify an explicit link
- %cont, fore "cyan"
- http://duh.org
- %cont, fore "white"
- or an explicit email
- %cont, fore "cyan"
- duh@somewhere.com
- %cont, fore "white"
- with label.
- %font "normal", size 5
- And remember,
- %prefix " "
- A TAB in front of the line does a quotation.
- %prefix " "
- More TABs, more depth (if allowed).
- %prefix " "
- %prefix " "
- %font "normal", size 5
- Nice.
- %page
- Lists
- %font "normal", size 5
- A list of items is natural, just putting a
- %cont, font "normal-b"
- dash
- %cont, font "normal"
- or
- a
- %cont, font "normal-b"
- plus
- %cont, font "normal"
- at the beginning of the line.
- %page
- Plain List
- %font "normal", size 5
- The dash is the default list identifier. For sublists,
- just add
- %cont, font "normal-b"
- spaces
- %cont, font "normal"
- at the beginning of the line. More
- spaces, more sublists.
- Earth
- America
- South America
- Brazil
- How deep can I go?
- Europe
- Lots of countries
- Mars
- Who knows?
- %font "normal", size 5
- The list ends with
- %cont, font "normal-b"
- two
- %cont, font "normal"
- consecutive blank lines.
- %page
- Numbered List
- %font "normal", size 5
- The same rules as the plain list, just a different
- identifier (plus).
- 1. one
- 2. two
- 3. three
- mixed lists!
- what a mess
- 1. counting again
- 2. ...
- 4. four
- %page
- Definition List
- %font "normal", size 5
- The definition list identifier is a colon, followed by
- the term. The term contents is placed on the next line.
-
- %cont, font "normal-b"
- orange
- %cont, font "normal"
- a yellow fruit
-
- %cont, font "normal-b"
- apple
- %cont, font "normal"
- a green or red fruit
-
- %cont, font "normal-b"
- other fruits
- %cont, font "normal"
- wee!
- mixing lists
- 1. again!
- 2. and again!
- %page
- Tables
- %font "normal", size 5
- Use pipes to compose table rows and cells.
- Double pipe at the line beginning starts a heading row.
- Natural spaces specify each cell alignment.
- %center
- %newimage "table_1.png"
- %font "normal", size 5
- Without the last pipe, no border:
- %center
- %newimage "table_2.png"
- %page
- Special Entities
- %font "normal", size 5
- Because things were too simple.
- %page
- Images
- %font "normal", size 5
- The image mark is as simple as it can be:
- %cont, font "mono"
- [filename]
- %cont, font "normal"
- .
- %font "normal", size 5
-
- %center
- %newimage "img/photo.jpg"
- %left
-
- %font "normal", size 5
- And with some targets the image is linkable :
- %font "normal", size 5
- (img/photo.jpg)
- %cont, fore "cyan"
- http://www.txt2tags.org
- %cont, fore "white"
-
- The filename must end in PNG, JPG, GIF, or similar.
- No spaces inside the brackets!
- %page
- Other
- %font "normal", size 5
- When the target needs, special chars like <, > and &
- are escaped.
- %font "normal", size 5
- The handy
- %cont, font "mono"
- %%date
- %cont, font "normal"
- macro expands to the current date.
- %font "normal", size 5
- So today is 20110710 on the ISO
- %cont, font "mono"
- YYYYMMDD
- %cont, font "normal"
- format.
- %font "normal", size 5
- You can also specify the date format with the %? flags,
- as
- %cont, font "mono"
- %%date(%m-%d-%Y)
- %cont, font "normal"
- which gives: 07-10-2011.
- %font "normal", size 5
- That's all for now.
- %bar "white" 5
- %font "normal", size 5
- %left
- %newimage "img/t2tpowered.png"
- %left
- (sample.t2t
- %cont, fore "cyan"
- sample.t2t
- %cont, fore "white"
- )
- %% mgp code generated by txt2tags 2.6.736 (http://txt2tags.org)
- %% cmdline: txt2tags -t mgp sample.t2t
- %%EOD