internal update
[s-roff.git] / tmac / arkup.tmac
blob8c52d121c3e304da0ce77e7c15dfd2191e2c410e
1 .\" arkup.tmac
2 .\"
3 .\" A simple set of macros to provide HTML documents with basic
4 .\" www functionality.  It will work with any macro set.
5 .\"
6 .de HTML
7 .  if '\*(.T'html' \{\
8 .\" the following line makes the vertical mode leave, so to say
9 \&
10 \X^html:\\$*^
11 .  \}
13 .de HTMLINDEX
14 .  if '\*(.T'html' \X^index:\\$*^
16 .\"
17 .\"  BODYCOLOR - $1 is foreground color
18 .\"              $2 is background color
19 .\"              $3 is the color of an active hypertext link
20 .\"              $4 is the color of a hypertext link not yet visited
21 .\"              $5 is the color of a visited hypertext link
22 .\"
23 .de BODYCOLOR
24 .  HTML <body text=\\$1 bgcolor=\\$2 link=\\$3 alink=\\$4 vlink=\\$5>
26 .\"
27 .\" BACKGROUND - $1 is the background image file
28 .\"
29 .de BACKGROUND
30 .  HTML <body background=\\$1>
32 .\"
33 .\"  URL - $1 is the classical underlined blue text
34 .\"        $2 is the url
35 .\"        $3 is optional stuff printed immediately after $3
36 .\"
37 .de URL
38 .  ie '\*(.T'html' \{\
39 .    HTML <a href="\\$2">\\$1</a>\\$3
40 .  \}
41 .  el \{\
42 \\$1 \(la\fC\\$2\fP\(ra\\$3
43 .  \}
45 .\"
46 .\"  FTP - $1 is the classical underlined blue text
47 .\"        $2 is the ftp url
48 .\"        $3 is optional stuff printed immediately after $2
49 .de FTP
50 .  ie '\*(.T'html' \{\
51 .    HTML <a href=\\$2>\\$1</a>\\$3
52 .  \}
53 .  el \{\
54 \\$1 \(la\fC\\$2\fP\(ra\\$3
55 .  \}
57 .\"
58 .\" MAILTO - generate html email reference
59 .\"          $1 is the email address (without the `mailto:' prefix)
60 .\"          $2 is the optional name
61 .\"          $3 is optional stuff printed immediately after $2 (resp. $1)
62 .\"
63 .\"          example:
64 .\"
65 .\"            Foobar has been written by
66 .\"            .MAILTO fred@foo.bar "Fredrick Bloggs" .
67 .\"
68 .de MAILTO
69 .\"
70 .\" force reset after a potential heading by performing some motion..
71 .\" how do we do this --fixme--
72 .\"  \h'\w' ''\h'-\w' '' doesn't work..
73 .  ie '\*(.T'html' \{\
74 .    ie '\\$2'' \{\
75 .      HTML "<a href=mailto:\\$1>\\$1</a>\\$3"
76 .    \}
77 .    el \{\
78 .      HTML "<a href=mailto:\\$1>\\$2</a>\\$3"
79 .    \}
80 .  \}
81 .  el \{\
82 .    ie '\\$2'' \{\
83 \fC\\$1\fP\\$3
84 .    \}
85 .    el \{\
86 \\$2 \(la\fC\\$1\fP\(ra\\$3
87 .    \}
88 .  \}
90 .\"
91 .\" TAG - generate an html name $1
92 .\"
93 .de TAG
94 .  HTML <a name="\\$1"></a>
96 .\"
97 .\" IMAGE - reference an image
98 .\"         $1 is the image file
99 .\"         $2 is the x width (default if absent 400 pixels)
100 .\"         $3 is the y width (default if absent is the x value)
102 .de IMAGE
103 .  ie '\*(.T'html' \{\
104 .    nr HTMLWIDTH 400
105 .    if '\\$2'' \{\
106 .      nr HTMLWIDTH \\$2
107 .    \}
108 .    nr HTMLHEIGHT \\n[HTMLWIDTH]
109 .    if '\\$3'' \{\
110 .      nr HTMLHEIGHT \\$3
111 .    \}
112 .    HTML <img src="\\$1" width=\\n[HTMLWIDTH height=\\n[HTMLHEIGHT]>
113 .  \}
114 .  el \{\
115 .    B1
116 \(la\fC\\$1\fP\(ra
117 .    B2
118 .  \}
121 .\" CDFTP - if we are processing this on machine \\$1 then we create a
122 .\"         FTP reference using \\$2 --> \\$3
124 .\"         otherwise we create a URL from \\$2 --> \\$4
126 .\"         example:
128 .\"         .CDFTP "foobar" "somegnusoftware.tar.gz" \
129 .\"                "ftp://ftp.gnu.org/gnu/somegnusoftware.tar.gz" \
130 .\"                "../../../TARGZ/somegnusoftware.tar.gz"
132 .\"         meaning if we are on machine foobar then generate an ftp url
133 .\"         to the GNU anonymous ftp server otherwise generate a file url
134 .\"         to a local copy (cdrom maybe)
136 .\"         Useful when one machine is designated as a cdrom burner and another
137 .\"         designated as an appache server.
138 .\"         The same source for web pages can be burnt onto a CD and also
139 .\"         served across the network. It doesn't solve the problem of one
140 .\"         machine doing both though :-(
141 .\"        
143 .\".de CDFTP
144 .\".  sy /bin/rm -f /tmp/n.tmac
145 .\".  sy /bin/echo ".ds HOSTNAME `hostname --short`" > /tmp/n.tmac
146 .\".  so /tmp/n.tmac
147 .\".  sy /bin/rm -f /tmp/n.tmac
148 .\".  ie '\\*[HOSTNAME]'\\$1' \{\
149 .\".    FTP "\\$2"  "\\$3"
150 .\".  \}
151 .\".  el \{\
152 .\".    URL  "\\$2" "\\$4"
153 .\".  \}
154 .\"..
155 .de LINE
156 .  HTML <hr>
159 .\" it doesn't make sense to use hyphenation with html, so we turn it off.
161 .hy 0
162 .nr HY 0