Debian Codegraph @

upstream/debian-trixie/man7/groff_www.7

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