summaryrefslogtreecommitdiffstats
path: root/contrib/groff/tmac/tmac.arkup
blob: b8c94df257a9454ec734dd4b37ddabbf85cb2c1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
.\"
.\"  a simple set of macros to provide HTML documents with basic www functionality
.\"
.\"  please can someone with more skill at creating macros improve on this
.\"  many thanks - Gaius
.\"
.\"  suggestion: maybe when run with non -Thtml all the urls should appear as
.\"  references.
.\"
.\" some simple html additions to any macro set
.\"
.de HTML
.if '\*(.T'html' \X^html:\\$*^
..
.de HTMLINDEX
.if '\*(.T'html' \X^index:\\$*^
..
.\"
.\"  BODYCOLOR - $1 is foreground color
.\"              $2 is background color
.\"              $3 is the color of an active hypertext link
.\"              $4 is the color of a hypertext link not yet visited
.\"              $5 is the color of a visited hypertext link
.\"
.de BODYCOLOR
.   HTML <body text=\\$1 bgcolor=\\$2 link=\\$3 alink=\\$4 vlink=\\$5>
..
.\"
.\" BACKGROUND - $1 is the background image file
.\"
.de BACKGROUND
.   HTML <body background=\\$1>
..
.\"
.\"  URL - $1 is the classical underlined blue text
.\"        $2 is the url
.\"
.de URL
.   ie '\*(.T'html' \{\
.        HTML <a href="\\$2">\\$1</a>
.   \}
.   el \{\
\\$1 (<url: \\$2>)
.   \}
..
.\"
.\"  LINK - $1 is the classical underlined blue text
.\"         $2 is the URL *with* the textual reference within a document
.\"
.\"         example:  .LINK "a nice heading" "#heading123"
.\"
.\"                    provides a link from "a nice heading" to the
.\"                    textual name reference "heading123"
.\"
.\"                   .LINK "The GNU FSF" "" "www.gnu.org"
.\"
.\"                    deprecated - use the URL macro instead
.\"         
.\"
.de LINK
.   ie !'\\$3'' \{\
.      @error the LINK macro has changed, use the URL (or FTP if appropriate) macro here
.      @error you are advised to replace with URL or FTP macro "\\$1" "\\$3#\\$2"
.      URL  "\\$1" "\\$3#\\$2"
.   \}
.   el \{\
.      ie '\*(.T'html' \{\
.          HTML <a href=\\$2>\\$1</a>
.      \}
.      el \{\
.          URL "\\$1" "\\$2"
.      \}          
.   \}
..
.\"
.\"  FTP - $1 is the classical underlined blue text
.\"        $2 is the ftp url
.de FTP
.   ie '\*(.T'html' \{\
.        HTML <a href=\\$2>\\$1</a>
.   \}
.   el \{\
$1 (<ftp:\\$2>)
.   \}
..
.\"
.\" MAILTO - generate html email reference
.\"          $1 is the email address
.\"          $2 is the optional name
.\"
.\"          example .MAILTO fred@foo.bar "Fredrick Bloggs"
.\"
.de MAILTO
.\"
.\" force reset after a potential heading by performing some motion..
.\" how do we do this --fixme--
.\"  \h'\w' ''\h'-\w' '' doesn't work..
.   ie '\*(.T'html' \{\
.        ie '\\$2'' \{\
.            HTML "<a href=mailto:\\$1>\\$1</a>"
.        \}
.        el \{\
.            HTML "<a href=mailto:\\$1>\\$2</a>"
.        \}
.   \}
.   el \{\
\s-2\fB<email:\\$1>\fP\s+2
.   \}
..
.\"
.\"
.\" TAG - generate an html name $1
.\"
.de TAG
.HTML <a name="\\$1"></a>
..
.\"
.\" IMAGE - reference an image
.\"         $1 is the image file
.\"         $2 is the x width (default if absent 400 pixels)
.\"         $3 is the y width (default if absent is the x value)
.\"
.de IMAGE
.   ie '\*(.T'html' \{\
.      nr HTMLWIDTH 400
.      if '\\$2'' \{\
.         nr HTMLWIDTH \\$2
.      \}
.      nr HTMLHEIGHT \\n[HTMLWIDTH]
.      if '\\$3'' \{\
.         nr HTMLHEIGHT \\$3
.      \}
.      HTML <img src="\\$1" width=\\n[HTMLWIDTH height=\\n[HTMLHEIGHT]>
.   \}
.   el \{\
.      B1
\fB\s-2<img src=\\$1>\fP\s+2
.      B2
.   \}
..
.\"
.\" CDFTP - if we are processing this on machine \\$1 then we create a
.\"         FTP reference using \\$2 --> \\$3
.\"
.\"         otherwise we create a URL from \\$2 --> \\$4
.\"
.\"         example:
.\"
.\"         .CDFTP "foobar" "somegnusoftware.tar.gz" \
.\"                "ftp://ftp.gnu.org/gnu/somegnusoftware.tar.gz" \
.\"                "../../../TARGZ/somegnusoftware.tar.gz"
.\"
.\"         meaning if we are on machine foobar then generate an ftp url
.\"         to the GNU anonymous ftp server otherwise generate a file url
.\"         to a local copy (cdrom maybe)
.\"
.\"         Useful when one machine is designated as a cdrom burner and another
.\"         designated as an appache server.
.\"         The same source for web pages can be burnt onto a CD and also
.\"         served across the network. It doesn't solve the problem of one
.\"         machine doing both though :-(
.\"         
.\"
.de CDFTP 
.   sy /bin/rm -f /tmp/tmac.n
.   sy /bin/echo ".ds HOSTNAME `hostname --short`" > /tmp/tmac.n
.   so /tmp/tmac.n
.   sy /bin/rm -f /tmp/tmac.n
.   ie '\\*[HOSTNAME]'\\$1' \{\
.      FTP "\\$2"  "\\$3"
.   \}
.   el \{\
.      URL  "\\$2" "\\$4"
.   \}
..
.\" it doesn't make sense to use hyphenation with html, so we turn it off.
.hy 0
.nr HY 0
OpenPOWER on IntegriCloud