2 .\" a simple set of macros to provide HTML documents with basic www functionality
4 .\" please can someone with more skill at creating macros improve on this
5 .\" many thanks - Gaius
7 .\" suggestion: maybe when run with non -Thtml all the urls should appear as
10 .\" some simple html additions to any macro set
13 .if '\*(.T'html' \X^html:\\$*^
16 .if '\*(.T'html' \X^index:\\$*^
19 .\" BODYCOLOR - $1 is foreground color
20 .\" $2 is background color
21 .\" $3 is the color of an active hypertext link
22 .\" $4 is the color of a hypertext link not yet visited
23 .\" $5 is the color of a visited hypertext link
26 . HTML <body text=\\$1 bgcolor=\\$2 link=\\$3 alink=\\$4 vlink=\\$5>
29 .\" BACKGROUND - $1 is the background image file
32 . HTML <body background=\\$1>
35 .\" URL - $1 is the classical underlined blue text
40 . HTML <a href="\\$2">\\$1</a>
47 .\" LINK - $1 is the classical underlined blue text
48 .\" $2 is the URL *with* the textual reference within a document
50 .\" example: .LINK "a nice heading" "#heading123"
52 .\" provides a link from "a nice heading" to the
53 .\" textual name reference "heading123"
55 .\" .LINK "The GNU FSF" "" "www.gnu.org"
57 .\" deprecated - use the URL macro instead
62 . @error the LINK macro has changed, use the URL (or FTP if appropriate) macro here
63 . @error you are advised to replace with URL or FTP macro "\\$1" "\\$3#\\$2"
64 . URL "\\$1" "\\$3#\\$2"
68 . HTML <a href=\\$2>\\$1</a>
76 .\" FTP - $1 is the classical underlined blue text
80 . HTML <a href=\\$2>\\$1</a>
87 .\" MAILTO - generate html email reference
88 .\" $1 is the email address
89 .\" $2 is the optional name
91 .\" example .MAILTO fred@foo.bar "Fredrick Bloggs"
95 .\" force reset after a potential heading by performing some motion..
96 .\" how do we do this --fixme--
97 .\" \h'\w' ''\h'-\w' '' doesn't work..
100 . HTML "<a href=mailto:\\$1>\\$1</a>"
103 . HTML "<a href=mailto:\\$1>\\$2</a>"
107 \s-2\fB<email:\\$1>\fP\s+2
112 .\" TAG - generate an html name $1
115 .HTML <a name="\\$1"></a>
118 .\" IMAGE - reference an image
119 .\" $1 is the image file
120 .\" $2 is the x width (default if absent 400 pixels)
121 .\" $3 is the y width (default if absent is the x value)
124 . ie '\*(.T'html' \{\
129 . nr HTMLHEIGHT \\n[HTMLWIDTH]
133 . HTML <img src="\\$1" width=\\n[HTMLWIDTH height=\\n[HTMLHEIGHT]>
137 \fB\s-2<img src=\\$1>\fP\s+2
142 .\" CDFTP - if we are processing this on machine \\$1 then we create a
143 .\" FTP reference using \\$2 --> \\$3
145 .\" otherwise we create a URL from \\$2 --> \\$4
149 .\" .CDFTP "foobar" "somegnusoftware.tar.gz" \
150 .\" "ftp://ftp.gnu.org/gnu/somegnusoftware.tar.gz" \
151 .\" "../../../TARGZ/somegnusoftware.tar.gz"
153 .\" meaning if we are on machine foobar then generate an ftp url
154 .\" to the GNU anonymous ftp server otherwise generate a file url
155 .\" to a local copy (cdrom maybe)
157 .\" Useful when one machine is designated as a cdrom burner and another
158 .\" designated as an appache server.
159 .\" The same source for web pages can be burnt onto a CD and also
160 .\" served across the network. It doesn't solve the problem of one
161 .\" machine doing both though :-(
165 . sy /bin/rm -f /tmp/tmac.n
166 . sy /bin/echo ".ds HOSTNAME `hostname --short`" > /tmp/tmac.n
168 . sy /bin/rm -f /tmp/tmac.n
169 . ie '\\*[HOSTNAME]'\\$1' \{\
176 .\" it doesn't make sense to use hyphenation with html, so we turn it off.