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