]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/groff/tmac/groff_www.man
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / groff / tmac / groff_www.man
1 .TH GROFF_WWW @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
2 .\" Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
3 .\" Free Software Foundation, Inc.
4 .\"      Written by Gaius Mulley (gaius@glam.ac.uk)
5 .\"
6 .\" This file is part of groff.
7 .\"
8 .\" groff is free software; you can redistribute it and/or modify it under
9 .\" the terms of the GNU General Public License as published by the Free
10 .\" Software Foundation; either version 2, or (at your option) any later
11 .\" version.
12 .\"
13 .\" groff is distributed in the hope that it will be useful, but WITHOUT ANY
14 .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 .\" for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public License along
19 .\" with groff; see the file COPYING.  If not, write to the Free Software
20 .\" Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
21 .\"
22 .\" user level guide to using the -mwww macroset
23 .\"
24 .
25 .do nr groff_www_C \n[.C]
26 .cp 0
27 .
28 .do mso www.tmac
29 .
30 .\" we need the .LK here as we use it in the middle as an example --
31 .\" once the user requests .LK then the automatic generation of links
32 .\" at the top of the document is suppressed.
33 .LK
34 .
35 .
36 .SH NAME
37 groff_www \- groff macros for authoring web pages
38 .HR
39 .
40 .
41 .SH SYNOPSIS
42 .B "groff \-mwww"
43 [ options ]
44 file ...
45 .
46 .
47 .SH DESCRIPTION
48 This manual page describes the GNU \-mwww macro package, which is part of
49 the groff document formatting system.
50 The manual page is very a basic guide, and the html device driver
51 .RB ( \%grohtml )
52 has been completely rewritten but still remains as in an alpha state.
53 It has been included into the distribution so that a lot of people have a
54 chance to test it.
55 Note that this macro file will be automatically called (via the
56 .B troffrc
57 file) if you use
58 .BR \-Thtml .
59 .PP
60 To see the hyperlinks in action, please format this man page with the
61 .B \%grohtml
62 device.
63 .PP
64 Here is a summary of the functions found in this macro set.
65 .ta 2iL
66 .nf
67 \&.JOBNAME      split output into multiple files
68 \&.HX   automatic heading level cut off;
69         $1 point for sections/headers
70 \&.BCL  specify colours on a web page
71 \&.BGIMG        specify background image
72 \&.URL  create a url using two parameters
73 \&.FTP  create an ftp reference
74 \&.MTO  create a html email address
75 \&.FTP  create an ftp reference
76 \&.TAG  generate an html name
77 \&.IMG  include an image file
78 \&.PIMG include png image
79 \&.MPIMG        place png on the margin and
80         wrap text around it
81 \&.HnS  begin heading
82 \&.HnE  end heading
83 \&.LK   emit automatically collected links.
84 \&.HR   produce a horizontal rule
85 \&.NHR  suppress automatic generation of rules.
86 \&.HTL  only generate HTML title
87 \&.HEAD add data to <head> block
88 \&.ULS  unorder list begin
89 \&.ULE  unorder list end
90 \&.OLS  ordered list begin
91 \&.OLE  ordered list end
92 \&.DLS  definition list begin
93 \&.DLE  definition list end
94 \&.LI   insert a list item
95 \&.DC   generate a drop capital
96 \&.HTML pass an html raw request to the
97         device driver
98 \&.CDS  code example begin
99 \&.CDE  code example end
100 .fi
101 .PP
102 Output of the
103 .BR pic ,
104 .BR eqn ,
105 .BR refer ,
106 and
107 .B tbl
108 preprocessors is acceptable as input.
109 .
110 .
111 .SH REQUESTS
112 .TP
113 .B .JOBNAME filename
114 Split output into multiple HTML files.
115 A file is split whenever a .SH or .NH\ 1 is encountered.
116 Its argument is the file stem name for future output files.
117 This option is equivalent to
118 .BR \%grohtml 's
119 .B \-j
120 option.
121 .TP
122 .B .HX n
123 Specify the cut off depth when generating links from section headings.
124 For example, a parameter of\~2 would cause
125 .B \%grohtml
126 to generate a list of links for
127 .B .NH\ 1
128 and
129 .B .NH\ 2
130 but not for
131 .BR .NH\ 3 .
132 Whereas
133 .RS
134 .IP
135 .nf
136 .B .HX 0
137 .fi
138 .RE
139 .IP
140 will tell
141 .B \%grohtml
142 that no heading links should be created at all.
143 Another method for turning automatic headings off is by issuing the
144 the command line switch
145 .B \-P\-l
146 to
147 .BR groff .
148 .
149 .TP
150 .B .BCL foreground background active not-visited visited
151 This macro takes five parameters: foreground, background, active hypertext
152 link, hypertext link not yet visited, and visited hypertext link colour.
153 .
154 .TP
155 .B .BGIMG imagefile
156 the only parameter to this macro is the background image file.
157 .
158 .TP
159 .B .URL url [description] [after]
160 generates
161 .TAG URL
162 a URL using either one, two or three arguments.
163 The first parameter is the actual URL, the second is the name of the link,
164 and the third is optional stuff to be printed immediately afterwards.
165 If
166 .B description
167 and
168 .B after
169 are absent then the
170 .B url
171 becomes the anchor text.
172 Hyphenation is disabled while printing the actual URL;
173 explicit breakpoints
174 should be inserted with the
175 .B \[rs]:
176 escape.
177 Here is how to encode
178 .URL http://\:foo.\:org/ "foo" :
179 .RS
180 .IP
181 .B .URL http://\[rs]:foo.\[rs]:org/ "foo" :
182 .RE
183 .IP
184 If this is processed by a device other than 
185 .B \-Thtml
186 it appears as:
187 .RS
188 .IP
189 \m[blue]foo\m[] \[la]\f[C]http://foo.org\f[]\[ra]:
190 .RE
191 .IP
192 The URL macro can be of any type; for example we can reference
193 .URL pic.html "Eric Raymond's pic guide" 
194 by:
195 .RS
196 .IP
197 .B .URL pic.html \[dq]Eric Raymond's pic guide\[dq]
198 .RE
199 .
200 .TP
201 .B .MTO address [description] [after]
202 Generate an email html reference.
203 The first argument is mandatory as the email address.
204 The optional second argument is the text you see in your browser
205 If an empty argument is given,
206 .B address
207 is used instead.
208 An optional third argument is stuff printed immediately afterwards.
209 Hyphenation is disabled while printing the actual email address.
210 For example, 
211 .MTO joe@user.org "Joe User"
212 was achieved by the following macro:
213 .RS
214 .IP
215 .B .MTO joe@user.org \[dq]Joe User\[dq]
216 .RE
217 .IP
218 Note that all the URLs actually are treated as consuming no textual space
219 in groff.
220 This could be considered as a bug since it causes some problems.
221 To circumvent this,
222 .B www.tmac
223 inserts a zero-width character which expands to a harmless space (only if
224 run with
225 .BR \-Thtml ).
226 .
227 .TP
228 .B .FTP url [description] [after]
229 indicates that data can be obtained via ftp.
230 The first argument is the url and the second is the browser text.
231 A third argument, similar to the macros above, is intended for stuff printed
232 immediately afterwards.
233 The second and the third parameter are optional.
234 Hyphenation is disabled while printing the actual URL.
235 As an example, here the location of the
236 .FTP ftp://\:ftp.gnu.org/ "GNU ftp server" .
237 The macro example above was specified by:
238 .RS
239 .IP
240 .B .FTP ftp://\[rs]:ftp.gnu.org/ \[dq]GNU ftp server\[dq] .
241 .RE
242 .
243 .TP
244 .B .TAG name
245 Generates an html name tag from its argument.
246 This can then be referenced using the
247 .URL #URL URL
248 macro.
249 As you can see, you must precede the tag name with
250 .B #
251 since it is a local reference.
252 This link was achieved via placing a TAG in the URL description above;
253 the source looks like this:
254 .RS
255 .IP
256 .nf
257 .ft B
258 \&.TP
259 \&.B URL
260 generates
261 \&.TAG URL
262 a URL using either two or three arguments.
263 \&.\|.\|.
264 .fi
265 .ft P
266 .RE
267 .
268 .TP
269 .B .IMG [-R|-L|-C] filename [width] [height]
270 Include a picture into the document.
271 The first argument is the horizontal location: right, left, or center
272 .RB ( \-R ,
273 .BR \-L ,
274 or
275 .BR \-C ).
276 Alignment is centered by default (-C).
277 The second argument is the filename.
278 The optional third and fourth arguments are the width and height.
279 If the width is absent it defaults to 1\~inch.
280 If the height is absent it defaults to the width.
281 This maps onto an html img tag.
282 If you are including a png image then it is advisable to use the
283 .B PIMG
284 macro.
285 .
286 .TP
287 .B .PIMG [-R|-L|-C] filename [width [height]]
288 Include an image in PNG format.
289 This macro takes exactly the same parameters as the
290 .B IMG
291 macro; it has the advantage of working with postscript and html devices
292 also since it can automatically convert the image into the EPS format,
293 using the following programs
294 of the
295 .B netpbm
296 package:
297 .BR pngtopnm ,
298 .BR pnmcrop ,
299 and
300 .BR pnmtops .
301 If the document isn't processed with
302 .B \-Thtml
303 it is necessary to use the
304 .B \-U
305 option of groff.
306 .
307 .TP
308 .B .MPIMG [-R|-L] [-G gap] filename [width [height]]
309 Place a PNG image on the margin and wrap text around it.
310 The first parameters are optional.
311 The alignment: left or right
312 .RB ( \-L
313 or
314 .BR \-R )
315 specifies the margin where the picture is placed at.
316 The default alignment is left
317 .RB ( -L ).
318 Optionally,
319 .BI \-G \~gap
320 can be used to arrange a gap between the picture
321 and the text that wraps around it.
322 The default gap width is zero.
323 .br
324 The first non-optional argument is the filename.
325 The optional following arguments are the width and height.
326 If the width is absent it defaults to 1\~inch.
327 If the height is absent it defaults to the width.
328 Example:
329 .RS
330 .IP
331 .nf
332 .ft B
333 \&.MPIMG -L -G 2c foo.png 3c 1.5c
334 .ft P
335 .fi
336 .RE
337 .IP
338 The height and width may also be given as percentages. The PostScript
339 device calculates the width from the
340 .B .l
341 register and the height from the
342 .B .p
343 register. For example:
344 .RS
345 .IP
346 .nf
347 .ft B
348 \&.MPIMG -L -G 2c foo.png 15%
349 .ft P
350 .fi
351 .RE
352 .
353 .TP
354 .B .HnS n
355 Begin heading.
356 The numeric heading level
357 .I n
358 is specified by the first parameter.
359 Use this macro if your headings contain URL, FTP or MTO macros.
360 Example:
361 .RS
362 .IP
363 .nf
364 .ft B
365 \&.HnS 1
366 \&.HR
367 GNU Troff
368 \&.URL http://groff.ffii.org (Groff) 
369 \&\(em a
370 \&.URL http://www.gnu.org/ GNU
371 \&project.
372 \&Hosted by
373 \&.URL http://ffii.org/ FFII .
374 \&.HR
375 \&.HnE
376 .ft P
377 .fi
378 .RE
379 .IP
380 In this case you might wish to
381 disable automatic links to headings.
382 This can be done via
383 .B \-P\-l
384 from the command line.
385 .\" or by using a call to `.HX 0'.
386
387 .
388 .TP
389 .B .HnE
390 End heading.
391 .
392 .TP
393 .B .LK
394 .TAG LK
395 Force \%grohtml to place the automatically generated links at this position.
396 If this manual page has been processed with
397 .B \-Thtml
398 those links can be seen right here.
399 .
400 .LK
401 .
402 .TP
403 .B .HR
404 Generate a full-width horizontal rule for
405 .BR \-Thtml .
406 No effect for all other devices.
407 .
408 .TP
409 .B .NHR
410 Suppress generation of the top and bottom rules which \%grohtml emits
411 by default.
412 .
413 .TP
414 .B .HTL
415 Generate an HTML title only.
416 This differs from the 
417 .B TL
418 macro of the
419 .B ms
420 macro package which generates both an HTML title and an <H1> heading.
421 Use it to provide an HTML title as search engine fodder but a graphic title
422 in the document.
423 The macro terminates when a space or break is seen (.sp, .br).
424 .
425 .TP
426 .B .HEAD
427 Add arbitrary HTML data to the <head> block.
428 Ignored if not processed with
429 .BR \-Thtml .
430 Example:
431 .RS
432 .IP
433 .nf
434 .B ".HEAD" "\[dq]<link \[rs]"
435 .B "  rel=\[dq]\[dq]icon\[dq]\[dq] \[rs]"
436 .B "  type=\[dq]\[dq]image/png\[dq]\[dq] \[rs]"
437 .B "  href=\[dq]\[dq]http://foo.org//bar.png\[dq]\[dq]/>\[dq]"
438 .fi
439 .ft P
440 .RE
441 .
442 .TP
443 .B .HTML
444 All text after this macro is treated as raw html.
445 If the document is processed without
446 .B \-Thtml
447 then the macro is ignored.
448 Internally, this macro is used as a building block for other higher-level
449 macros.
450 .IP
451 For example, the
452 .B BGIMG
453 macro is defined as
454 .RS
455 .IP
456 .nf
457 .ft B
458 \&.de BGIMG
459 \&.   HTML <body background=\[rs]$1>
460 \&..
461 .ft P
462 .fi
463 .RE
464 .
465 .TP
466 .B .DC l text [color]
467 Produce a drop capital.
468 The first parameter is the letter to be dropped and enlarged, the second
469 parameter
470 .B text
471 is the ajoining text whose height the first letter should not exceed.
472 The optional third parameter is the color of the dropped letter.
473 It defaults to black.
474 .
475 .TP
476 .B ".CDS"
477 Start displaying a code section in constant width font.
478 .
479 .TP
480 .B ".CDE"
481 End code display
482 .
483 .SH SECTION HEADING LINKS
484 By default
485 .B \%grohtml
486 generates links to all section headings and places these at the top of the
487 html document. (See
488 .URL #LK LINKS
489 for details of how to switch this off or alter the position).
490 .
491 .
492 .SH LIMITATIONS OF GROHTML
493 .LP
494 .B tbl
495 information is currently rendered as a PNG image.
496 .
497 .
498 .SH FILES
499 @MACRODIR@/www.tmac
500 .
501 .
502 .SH "SEE ALSO"
503 .BR groff (@MAN1EXT@),
504 .BR @g@troff (@MAN1EXT@)
505 .BR \%grohtml (@MAN1EXT@),
506 .BR netpbm (1)
507 .
508 .
509 .SH AUTHOR
510 .B \%grohtml
511 was written by
512 .MTO gaius@glam.ac.uk "Gaius Mulley"
513 .
514 .
515 .SH BUGS
516 Report bugs to the
517 .MTO bug-groff@\:gnu.org "Groff Bug Mailing List" .
518 Include a complete, self-contained example that will allow the bug to be
519 reproduced, and say which version of groff you are using.
520 .
521 .cp \n[groff_www_C]
522 .
523 .\" Local Variables:
524 .\" mode: nroff
525 .\" End: