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