Imported Upstream version 1.22.3
[platform/upstream/groff.git] / tmac / groff_www.7.man
1 .TH GROFF_WWW @MAN7EXT@ "@MDATE@" "groff @VERSION@"
2 .SH NAME
3 groff_www \- groff macros for authoring web pages
4 .
5 .\" User level guide to using the -mwww macroset
6 .
7 .
8 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
9 .do nr groff_www_C \n[.C]
10 .cp 0
11 .do mso www.tmac
12 .
13 .
14 .\" ====================================================================
15 .\" Legal Terms
16 .\" ====================================================================
17 .\"
18 .\" Copyright (C) 2000-2018 Free Software Foundation, Inc.
19 .\"
20 .\" This file is part of groff, the GNU roff type-setting system.
21 .\"
22 .\" This program is free software: you can redistribute it and/or modify
23 .\" it under the terms of the GNU General Public License as published by
24 .\" the Free Software Foundation, either version 3 of the License, or
25 .\" (at your option) any later version.
26 .\"
27 .\" This program is distributed in the hope that it will be useful, but
28 .\" WITHOUT ANY WARRANTY; without even the implied warranty of
29 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
30 .\" General Public License for more details.
31 .\"
32 .\" You should have received a copy of the GNU General Public License
33 .\" along with this program.  If not, see
34 .\" <http://www.gnu.org/licenses/>.
35 .
36 .
37 .\" we need the .LK here as we use it in the middle as an example --
38 .\" once the user requests .LK then the automatic generation of links
39 .\" at the top of the document is suppressed.
40 .LK
41 .
42 .HR
43 .
44 .
45 .\" ====================================================================
46 .SH SYNOPSIS
47 .\" ====================================================================
48 .
49 .SY "groff \-m www"
50 .RI [ option
51 \&.\|.\|.\&]
52 .RI [ input-file
53 \&.\|.\|.\&]
54 .
55 .
56 .\" ====================================================================
57 .SH DESCRIPTION
58 .\" ====================================================================
59 .
60 This manual page describes the GNU \-mwww macro package, which is part of
61 the groff document formatting system.
62 .
63 The manual page is very a basic guide, and the HTML device driver
64 .RB ( \%grohtml )
65 has been completely rewritten but still remains as in an alpha state.
66 .
67 It has been included into the distribution so that a lot of people have a
68 chance to test it.
69 .
70 Note that this macro file is automatically called (via the
71 .I troffrc
72 file) if you use
73 .B \-Thtml
74 or
75 .BR \-Txhtml .
76 .
77 .
78 .PP
79 To see the hyperlinks in action, please format this man page with the
80 .B \%grohtml
81 device.
82 .
83 .
84 .PP
85 Here is a summary of the functions found in this macro set.
86 .TS
87 tab(@);
88 l l.
89 \&.JOBNAME@split output into multiple files
90 \&.HX@automatic heading level cut off
91 \&.BCL@specify colours on a web page
92 \&.BGIMG@specify background image
93 \&.URL@create a URL using two parameters
94 \&.FTP@create an FTP reference
95 \&.MTO@create an HTML email address
96 \&.TAG@generate an HTML name
97 \&.IMG@include an image file
98 \&.PIMG@include PNG image
99 \&.MPIMG@place PNG on the margin and wrap text around it
100 \&.HnS@begin heading
101 \&.HnE@end heading
102 \&.LK@emit automatically collected links.
103 \&.HR@produce a horizontal rule
104 \&.NHR@suppress automatic generation of rules.
105 \&.HTL@only generate HTML title
106 \&.HEAD@add data to <head> block
107 \&.ULS@unorder list begin
108 \&.ULE@unorder list end
109 \&.OLS@ordered list begin
110 \&.OLE@ordered list end
111 \&.DLS@definition list begin
112 \&.DLE@definition list end
113 \&.LI@insert a list item
114 \&.DC@generate a drop capital
115 \&.HTML@pass an HTML raw request to the device driver
116 \&.CDS@code example begin
117 \&.CDE@code example end
118 \&.ALN@place links on left of main text.
119 \&.LNS@start a new two-column table with links in the left.
120 \&.LNE@end the two-column table.
121 \&.LINKSTYLE@initialize default URL attributes.
122 .TE
123 .
124 .
125 .PP
126 Output of the
127 .BR pic ,
128 .BR eqn ,
129 .BR refer ,
130 and
131 .B tbl
132 preprocessors is acceptable as input.
133 .
134 .
135 .\" ====================================================================
136 .SH REQUESTS
137 .\" ====================================================================
138 .
139 .TP
140 .B .JOBNAME filename
141 Split output into multiple HTML files.
142 .
143 A file is split whenever a \&.SH or \&.NH\ 1 is encountered.
144 .
145 Its argument is the file stem name for future output files.
146 .
147 This option is equivalent to
148 .BR \%grohtml 's
149 .B \-j
150 option.
151 .
152 .TP
153 .B .HX n
154 Specify the cut off depth when generating links from section headings.
155 .
156 For example, a parameter of\~2 would cause
157 .B \%grohtml
158 to generate a list of links for
159 .B .NH\ 1
160 and
161 .B .NH\ 2
162 but not for
163 .BR .NH\ 3 .
164 .
165 Whereas
166 .RS
167 .IP
168 .nf
169 .B .HX 0
170 .fi
171 .RE
172 .IP
173 tells
174 .B \%grohtml
175 that no heading links should be created at all.
176 .
177 Another method for turning automatic headings off is by issuing the
178 command-line switch
179 .B \-P\-l
180 to
181 .BR groff .
182 .
183 .TP
184 .B .BCL foreground background active not-visited visited
185 This macro takes five parameters: foreground, background, active hypertext
186 link, hypertext link not yet visited, and visited hypertext link colour.
187 .
188 .TP
189 .B .BGIMG imagefile
190 the only parameter to this macro is the background image file.
191 .
192 .TP
193 .B .URL url [description] [after]
194 generates
195 .TAG URL
196 a URL using either one, two or three arguments.
197 .
198 The first parameter is the actual URL, the second is the name of the
199 link, and the third is optional stuff to be printed immediately
200 afterwards.
201 .
202 If
203 .B description
204 and
205 .B after
206 are absent then the
207 .B URL
208 becomes the anchor text.
209 .
210 Hyphenation is disabled while printing the actual URL;
211 explicit breakpoints should be inserted with the
212 .B \[rs]:
213 escape.
214 .
215 Here is how to encode
216 .UR http://\:foo.\:org/
217 foo
218 .UE :
219 .RS
220 .IP
221 .B .URL http://\[rs]:foo.\[rs]:org/ "foo" :
222 .RE
223 .
224 .IP
225 If this is processed by a device other than
226 .B \-Thtml
227 or
228 .B \-Txhtml
229 it appears as:
230 .RS
231 .IP
232 foo \[la]\f[CR]http://foo.org\f[]\[ra]:
233 .RE
234 .
235 .IP
236 The URL macro can be of any type; for example we can reference
237 .UR pic.html
238 Eric Raymond's pic guide
239 .UE
240 by:
241 .RS
242 .IP
243 .B .URL pic.html \[dq]Eric Raymond's pic guide\[dq]
244 .RE
245 .
246 .TP
247 .B .MTO address [description] [after]
248 Generate an email HTML reference.
249 .
250 The first argument is mandatory as the email address.
251 .
252 The optional second argument is the text you see in your browser.
253 .
254 If an empty argument is given,
255 .B address
256 is used instead.
257 .
258 An optional third argument is stuff printed immediately afterwards.
259 .
260 Hyphenation is disabled while printing the actual email address.
261 .
262 For example,
263 .MT joe@user.org
264 Joe User
265 .ME
266 can be achieved by the following macro:
267 .RS
268 .IP
269 .B .MTO joe@user.org \[dq]Joe User\[dq]
270 .RE
271 .
272 .IP
273 Note that all the URLs actually are treated as consuming no textual
274 space in groff.
275 .
276 This could be considered as a bug since it causes some problems.
277 .
278 To circumvent this,
279 .B www.tmac
280 inserts a zero-width character which expands to a harmless space (only
281 if run with
282 .B \-Thtml
283 or
284 .BR \-Txhtml ).
285 .
286 .TP
287 .B .FTP url [description] [after]
288 indicates that data can be obtained via FTP.
289 .
290 The first argument is the URL and the second is the browser text.
291 .
292 A third argument, similar to the macros above, is intended for stuff
293 printed immediately afterwards.
294 .
295 The second and the third parameter are optional.
296 .
297 Hyphenation is disabled while printing the actual URL.
298 .
299 As an example, here is the location of the
300 .UR ftp://\:ftp.gnu.org/
301 GNU FTP server
302 .UE .
303 .
304 The macro example above can be specified as:
305 .RS
306 .IP
307 .B .FTP ftp://\[rs]:ftp.gnu.org/ \[dq]GNU FTP server\[dq] .
308 .RE
309 .
310 .TP
311 .B .TAG name
312 Generates an HTML name tag from its argument.
313 .
314 This can then be referenced using the
315 .UR #URL
316 URL
317 .UE
318 macro.
319 .
320 As you can see, you must precede the tag name with
321 .B #
322 since it is a local reference.
323 .
324 This link was achieved via placing a TAG in the URL description above;
325 the source looks like this:
326 .RS
327 .IP
328 .nf
329 .ft B
330 \&.TP
331 \&.B URL
332 generates
333 \&.TAG URL
334 a URL using either two or three arguments.
335 \&.\|.\|.
336 .fi
337 .ft P
338 .RE
339 .
340 .TP
341 .B .IMG [\-R|\-L|\-C] filename [width] [height]
342 Include a picture into the document.
343 .
344 The first argument is the horizontal location: right, left, or center
345 .RB ( \-R ,
346 .BR \-L ,
347 or
348 .BR \-C ).
349 .
350 Alignment is centered by default
351 .RB ( \-C ).
352 .
353 The second argument is the filename.
354 .
355 The optional third and fourth arguments are the width and height.
356 .
357 If the width is absent it defaults to 1\~inch.
358 .
359 If the height is absent it defaults to the width.
360 .
361 This maps onto an HTML img tag.
362 .
363 If you are including a PNG image then it is advisable to use the
364 .B PIMG
365 macro.
366 .
367 .TP
368 .B .PIMG [\-R|\-L|\-C] filename [width [height]]
369 Include an image in PNG format.
370 .
371 This macro takes exactly the same parameters as the
372 .B IMG
373 macro; it has the advantage of working with PostScript and HTML devices
374 also since it can automatically convert the image into the EPS format,
375 using the following programs of the
376 .B netpbm
377 package:
378 .BR pngtopnm ,
379 .BR pnmcrop ,
380 and
381 .BR pnmtops .
382 .
383 If the document isn't processed with
384 .B \-Thtml
385 or
386 .B \-Txhtml
387 it is necessary to use the
388 .B \-U
389 option of groff.
390 .
391 .TP
392 .B .MPIMG [\-R|\-L] [\-G gap] filename [width [height]]
393 Place a PNG image on the margin and wrap text around it.
394 .
395 The first parameters are optional.
396 .
397 The alignment: left or right
398 .RB ( \-L
399 or
400 .BR \-R )
401 specifies the margin where the picture is placed at.
402 .
403 The default alignment is left
404 .RB ( \-L ).
405 .
406 Optionally,
407 .BI \-G \~gap
408 can be used to arrange a gap between the picture and the text that
409 wraps around it.
410 .
411 The default gap width is zero.
412 .
413 .br
414 The first non-optional argument is the filename.
415 .
416 The optional following arguments are the width and height.
417 .
418 If the width is absent it defaults to 1\~inch.
419 .
420 If the height is absent it defaults to the width.
421 .
422 Example:
423 .RS
424 .IP
425 .nf
426 .ft B
427 \&.MPIMG \-L \-G 2c foo.png 3c 1.5c
428 .ft P
429 .fi
430 .RE
431 .
432 .IP
433 The height and width may also be given as percentages.
434 .
435 The PostScript device calculates the width from the
436 .B .l
437 register and the height from the
438 .B .p
439 register.
440 .
441 For example:
442 .RS
443 .IP
444 .nf
445 .ft B
446 \&.MPIMG \-L \-G 2c foo.png 15%
447 .ft P
448 .fi
449 .RE
450 .
451 .TP
452 .B .HnS n
453 Begin heading.
454 .
455 The numeric heading level
456 .I n
457 is specified by the first parameter.
458 .
459 Use this macro if your headings contain URL, FTP or MTO macros.
460 .
461 Example:
462 .RS
463 .IP
464 .nf
465 .ft B
466 \&.HnS 1
467 \&.HR
468 GNU Troff
469 \&.URL http://groff.ffii.org (Groff)
470 \&\(em a
471 \&.URL http://www.gnu.org/ GNU
472 \&project.
473 \&Hosted by
474 \&.URL http://ffii.org/ FFII .
475 \&.HR
476 \&.HnE
477 .ft P
478 .fi
479 .RE
480 .
481 .IP
482 In this case you might wish to disable automatic links to headings.
483 .
484 This can be done via
485 .B \-P\-l
486 from the command line.
487 .\" or by using a call to \[lq].HX 0\[rq].
488 .
489 .
490 .TP
491 .B .HnE
492 End heading.
493 .
494 .
495 .TP
496 .B .LK
497 .TAG LK
498 Force \%grohtml to place the automatically generated links at this
499 position.
500 .
501 If this manual page has been processed with
502 .B \-Thtml
503 or
504 .B \-Txhtml
505 those links can be seen right here.
506 .
507 .LK
508 .
509 .TP
510 .B .HR
511 Generate a full-width horizontal rule for
512 .B \-Thtml
513 and
514 .BR \-Txhtml .
515 .
516 No effect for all other devices.
517 .
518 .TP
519 .B .NHR
520 Suppress generation of the top and bottom rules which \%grohtml emits
521 by default.
522 .
523 .TP
524 .B .HTL
525 Generate an HTML title only.
526 .
527 This differs from the
528 .B TL
529 macro of the
530 .B ms
531 macro package which generates both an HTML title and an <H1> heading.
532 .
533 Use it to provide an HTML title as search engine fodder but a graphic
534 title in the document.
535 .
536 The macro terminates when a space or break is seen (.sp, \&.br).
537 .
538 .TP
539 .B .HEAD
540 Add arbitrary HTML data to the <head> block.
541 .
542 Ignored if not processed with
543 .B \-Thtml
544 or
545 .BR \-Txhtml .
546 .
547 Example:
548 .RS
549 .IP
550 .nf
551 .B ".HEAD" "\[dq]<link \[rs]"
552 .B "  rel=\[dq]\[dq]icon\[dq]\[dq] \[rs]"
553 .B "  type=\[dq]\[dq]image/png\[dq]\[dq] \[rs]"
554 .B "  href=\[dq]\[dq]http://foo.org//bar.png\[dq]\[dq]/>\[dq]"
555 .fi
556 .ft P
557 .RE
558 .
559 .TP
560 .B .HTML
561 All text after this macro is treated as raw HTML.
562 .
563 If the document is processed without
564 .B \-Thtml
565 or
566 .B \-Txhtml
567 then the macro is ignored.
568 .
569 Internally, this macro is used as a building block for other
570 higher-level macros.
571 .
572 .IP
573 For example, the
574 .B BGIMG
575 macro is defined as
576 .RS
577 .IP
578 .nf
579 .ft B
580 \&.de BGIMG
581 \&.   HTML <body background=\[rs]\[rs]$1>
582 \&..
583 .ft P
584 .fi
585 .RE
586 .
587 .
588 .TP
589 .B .DC l text [color]
590 Produce a drop capital.
591 .
592 The first parameter is the letter to be dropped and enlarged, the second
593 parameter
594 .B text
595 is the adjoining text whose height the first letter should not exceed.
596 .
597 The optional third parameter is the color of the dropped letter.
598 .
599 It defaults to black.
600 .
601 .TP
602 .B ".CDS"
603 Start displaying a code section in constant width font.
604 .
605 .TP
606 .B ".CDE"
607 End code display
608 .
609 .TP
610 .B ".ALN [color] [percentage]"
611 Place section heading links automatically to the left of the main text.
612 .
613 The color argument is optional and if present indicates which HTML
614 background color is to be used under the links.
615 .
616 The optional percentage indicates the amount of width to devote to
617 displaying the links.
618 .
619 The default values are #eeeeee and 30 for color and percentage width,
620 respectively.
621 .
622 This macro should only be called once at the beginning of the document.
623 .
624 After calling this macro each section heading emits an HTML table
625 consisting of the links in the left and the section text on the right.
626 .
627 .TP
628 .B ".LNS"
629 Start a new two-column table with links in the left column.
630 .
631 This can be called if the document has text before the first \&.SH and
632 if \&.ALN is used.
633 .
634 Typically this is called just before the first paragraph and after the
635 main title as it indicates that text after this point should be
636 positioned to the right of the left-hand navigational links.
637 .
638 .TP
639 .B ".LNE"
640 End a two-column table.
641 .
642 This should be called at the end of the document if \&.ALN was used.
643 .
644 .TP
645 .B ".LINKSTYLE color [ fontstyle [ openglyph closeglyph ] ]"
646 Initialize default URL attributes to be used if this macro set is not
647 used with the HTML device.
648 .
649 The macro set initializes itself with the following call
650 .RS
651 .IP
652 .nf
653 .ft B
654 \&.LINKSTYLE blue CR \e[la] \e[ra]
655 .ft P
656 .fi
657 .RE
658 .
659 .IP
660 but these values will be superseded by a user call to LINKSTYLE.
661 .
662 .
663 .\" ====================================================================
664 .SH SECTION HEADING LINKS
665 .\" ====================================================================
666 .
667 By default
668 .B \%grohtml
669 generates links to all section headings and places these at the top of the
670 HTML document.
671 .
672 (See
673 .UR #LK
674 LINKS
675 .UE
676 for details of how to switch this off or alter the position).
677 .
678 .
679 .\" ====================================================================
680 .SH LIMITATIONS OF GROHTML
681 .\" ====================================================================
682 .
683 .LP
684 .B tbl
685 information is currently rendered as a PNG image.
686 .
687 .
688 .\" ====================================================================
689 .SH FILES
690 .\" ====================================================================
691 .
692 .I @MACRODIR@/www.tmac
693 .
694 .
695 .\" ====================================================================
696 .SH AUTHORS
697 .\" ====================================================================
698 The
699 .I www
700 macro package
701 was written by
702 .MT gaius@\:glam.ac.uk
703 Gaius Mulley
704 .ME ,
705 with additions by
706 .MT wl@\:gnu.org
707 Werner Lemberg
708 .ME
709 and
710 .MT groff\-bernd.warken\-72@\:web.de
711 Bernd Warken
712 .ME .
713 .
714 .
715 .\" ====================================================================
716 .SH "SEE ALSO"
717 .\" ====================================================================
718 .BR groff (@MAN1EXT@),
719 .BR @g@troff (@MAN1EXT@),
720 .BR \%grohtml (@MAN1EXT@),
721 .BR netpbm (1)
722 .
723 .
724 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
725 .cp \n[groff_www_C]
726 .
727 .
728 .\" Local Variables:
729 .\" mode: nroff
730 .\" End:
731 .\" vim: set filetype=groff: