* tmac/www.tmac (TS, TE, EQ, EN): Don't use .als for setting up
[s-roff.git] / tmac / groff_www.man
blob1af3195f0ee26c157b38131d3cb24294db34472b
1 .TH GROFF_WWW @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
2 .\" Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008
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 .\"
25 .do nr groff_www_C \n[.C]
26 .cp 0
28 .do mso www.tmac
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
36 .SH NAME
37 groff_www \- groff macros for authoring web pages
38 .HR
41 .SH SYNOPSIS
42 .B "groff \-mwww"
43 [ options ]
44 file ...
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 is automatically called (via the
56 .B troffrc
57 file) if you use
58 .B \-Thtml
60 .BR \-Txhtml .
61 .PP
62 To see the hyperlinks in action, please format this man page with the
63 .B \%grohtml
64 device.
65 .PP
66 Here is a summary of the functions found in this macro set.
67 .TS
68 tab(@);
69 l l.
70 \&.JOBNAME@split output into multiple files
71 \&.HX@automatic heading level cut off
72 \&.BCL@specify colours on a web page
73 \&.BGIMG@specify background image
74 \&.URL@create a url using two parameters
75 \&.FTP@create an ftp reference
76 \&.MTO@create a html email address
77 \&.FTP@create an ftp reference
78 \&.TAG@generate an html name
79 \&.IMG@include an image file
80 \&.PIMG@include png image
81 \&.MPIMG@place png on the margin and wrap text around it
82 \&.HnS@begin heading
83 \&.HnE@end heading
84 \&.LK@emit automatically collected links.
85 \&.HR@produce a horizontal rule
86 \&.NHR@suppress automatic generation of rules.
87 \&.HTL@only generate HTML title
88 \&.HEAD@add data to <head> block
89 \&.ULS@unorder list begin
90 \&.ULE@unorder list end
91 \&.OLS@ordered list begin
92 \&.OLE@ordered list end
93 \&.DLS@definition list begin
94 \&.DLE@definition list end
95 \&.LI@insert a list item
96 \&.DC@generate a drop capital
97 \&.HTML@pass an html raw request to the device driver
98 \&.CDS@code example begin
99 \&.CDE@code example end
100 \&.ALN@place links on left of main text.
101 \&.LNS@start a new two-column table with links in the left.
102 \&.LNE@end the two-column table.
103 \&.LINKSTYLE@initialize default url attributes.
106 Output of the
107 .BR pic ,
108 .BR eqn ,
109 .BR refer ,
111 .B tbl
112 preprocessors is acceptable as input.
115 .SH REQUESTS
117 .B .JOBNAME filename
118 Split output into multiple HTML files.
119 A file is split whenever a .SH or .NH\ 1 is encountered.
120 Its argument is the file stem name for future output files.
121 This option is equivalent to
122 .BR \%grohtml 's
123 .B \-j
124 option.
126 .B .HX n
127 Specify the cut off depth when generating links from section headings.
128 For example, a parameter of\~2 would cause
129 .B \%grohtml
130 to generate a list of links for
131 .B .NH\ 1
133 .B .NH\ 2
134 but not for
135 .BR .NH\ 3 .
136 Whereas
140 .B .HX 0
144 tells
145 .B \%grohtml
146 that no heading links should be created at all.
147 Another method for turning automatic headings off is by issuing the
148 the command line switch
149 .B \-P\-l
151 .BR groff .
154 .B .BCL foreground background active not-visited visited
155 This macro takes five parameters: foreground, background, active hypertext
156 link, hypertext link not yet visited, and visited hypertext link colour.
159 .B .BGIMG imagefile
160 the only parameter to this macro is the background image file.
163 .B .URL url [description] [after]
164 generates
165 .TAG URL
166 a URL using either one, two or three arguments.
167 The first parameter is the actual URL, the second is the name of the link,
168 and the third is optional stuff to be printed immediately afterwards.
170 .B description
172 .B after
173 are absent then the
174 .B url
175 becomes the anchor text.
176 Hyphenation is disabled while printing the actual URL;
177 explicit breakpoints
178 should be inserted with the
179 .B \[rs]:
180 escape.
181 Here is how to encode
182 .URL http://\:foo.\:org/ "foo" :
185 .B .URL http://\[rs]:foo.\[rs]:org/ "foo" :
188 If this is processed by a device other than 
189 .B \-Thtml
191 .B \-Txhtml
192 it appears as:
195 foo \[la]\f[C]http://foo.org\f[]\[ra]:
198 The URL macro can be of any type; for example we can reference
199 .URL pic.html "Eric Raymond's pic guide" 
203 .B .URL pic.html \[dq]Eric Raymond's pic guide\[dq]
207 .B .MTO address [description] [after]
208 Generate an email html reference.
209 The first argument is mandatory as the email address.
210 The optional second argument is the text you see in your browser
211 If an empty argument is given,
212 .B address
213 is used instead.
214 An optional third argument is stuff printed immediately afterwards.
215 Hyphenation is disabled while printing the actual email address.
216 For example, 
217 .MTO joe@user.org "Joe User"
218 was achieved by the following macro:
221 .B .MTO joe@user.org \[dq]Joe User\[dq]
224 Note that all the URLs actually are treated as consuming no textual space
225 in groff.
226 This could be considered as a bug since it causes some problems.
227 To circumvent this,
228 .B www.tmac
229 inserts a zero-width character which expands to a harmless space (only if
230 run with
231 .B \-Thtml
233 .BR \-Txhtml ).
236 .B .FTP url [description] [after]
237 indicates that data can be obtained via ftp.
238 The first argument is the url and the second is the browser text.
239 A third argument, similar to the macros above, is intended for stuff printed
240 immediately afterwards.
241 The second and the third parameter are optional.
242 Hyphenation is disabled while printing the actual URL.
243 As an example, here the location of the
244 .FTP ftp://\:ftp.gnu.org/ "GNU ftp server" .
245 The macro example above was specified by:
248 .B .FTP ftp://\[rs]:ftp.gnu.org/ \[dq]GNU ftp server\[dq] .
252 .B .TAG name
253 Generates an html name tag from its argument.
254 This can then be referenced using the
255 .URL #URL URL
256 macro.
257 As you can see, you must precede the tag name with
258 .B #
259 since it is a local reference.
260 This link was achieved via placing a TAG in the URL description above;
261 the source looks like this:
265 .ft B
266 \&.TP
267 \&.B URL
268 generates
269 \&.TAG URL
270 a URL using either two or three arguments.
271 \&.\|.\|.
273 .ft P
277 .B .IMG [-R|-L|-C] filename [width] [height]
278 Include a picture into the document.
279 The first argument is the horizontal location: right, left, or center
280 .RB ( \-R ,
281 .BR \-L ,
283 .BR \-C ).
284 Alignment is centered by default (-C).
285 The second argument is the filename.
286 The optional third and fourth arguments are the width and height.
287 If the width is absent it defaults to 1\~inch.
288 If the height is absent it defaults to the width.
289 This maps onto an html img tag.
290 If you are including a png image then it is advisable to use the
291 .B PIMG
292 macro.
295 .B .PIMG [-R|-L|-C] filename [width [height]]
296 Include an image in PNG format.
297 This macro takes exactly the same parameters as the
298 .B IMG
299 macro; it has the advantage of working with postscript and html devices
300 also since it can automatically convert the image into the EPS format,
301 using the following programs
302 of the
303 .B netpbm
304 package:
305 .BR pngtopnm ,
306 .BR pnmcrop ,
308 .BR pnmtops .
309 If the document isn't processed with
310 .B \-Thtml
312 .B \-Txhtml
313 it is necessary to use the
314 .B \-U
315 option of groff.
318 .B .MPIMG [-R|-L] [-G gap] filename [width [height]]
319 Place a PNG image on the margin and wrap text around it.
320 The first parameters are optional.
321 The alignment: left or right
322 .RB ( \-L
324 .BR \-R )
325 specifies the margin where the picture is placed at.
326 The default alignment is left
327 .RB ( -L ).
328 Optionally,
329 .BI \-G \~gap
330 can be used to arrange a gap between the picture
331 and the text that wraps around it.
332 The default gap width is zero.
334 The first non-optional argument is the filename.
335 The optional following arguments are the width and height.
336 If the width is absent it defaults to 1\~inch.
337 If the height is absent it defaults to the width.
338 Example:
342 .ft B
343 \&.MPIMG -L -G 2c foo.png 3c 1.5c
344 .ft P
348 The height and width may also be given as percentages. The PostScript
349 device calculates the width from the
350 .B .l
351 register and the height from the
352 .B .p
353 register. For example:
357 .ft B
358 \&.MPIMG -L -G 2c foo.png 15%
359 .ft P
364 .B .HnS n
365 Begin heading.
366 The numeric heading level
367 .I n
368 is specified by the first parameter.
369 Use this macro if your headings contain URL, FTP or MTO macros.
370 Example:
374 .ft B
375 \&.HnS 1
376 \&.HR
377 GNU Troff
378 \&.URL http://groff.ffii.org (Groff) 
379 \&\(em a
380 \&.URL http://www.gnu.org/ GNU
381 \&project.
382 \&Hosted by
383 \&.URL http://ffii.org/ FFII .
384 \&.HR
385 \&.HnE
386 .ft P
390 In this case you might wish to
391 disable automatic links to headings.
392 This can be done via
393 .B \-P\-l
394 from the command line.
395 .\" or by using a call to `.HX 0'.
399 .B .HnE
400 End heading.
403 .B .LK
404 .TAG LK
405 Force \%grohtml to place the automatically generated links at this position.
406 If this manual page has been processed with
407 .B \-Thtml
409 .B \-Txhtml
410 those links can be seen right here.
415 .B .HR
416 Generate a full-width horizontal rule for
417 .B \-Thtml
419 .BR \-Txhtml .
420 No effect for all other devices.
423 .B .NHR
424 Suppress generation of the top and bottom rules which \%grohtml emits
425 by default.
428 .B .HTL
429 Generate an HTML title only.
430 This differs from the 
431 .B TL
432 macro of the
433 .B ms
434 macro package which generates both an HTML title and an <H1> heading.
435 Use it to provide an HTML title as search engine fodder but a graphic title
436 in the document.
437 The macro terminates when a space or break is seen (.sp, .br).
440 .B .HEAD
441 Add arbitrary HTML data to the <head> block.
442 Ignored if not processed with
443 .B \-Thtml
445 .BR \-Txhtml .
446 Example:
450 .B ".HEAD" "\[dq]<link \[rs]"
451 .B "  rel=\[dq]\[dq]icon\[dq]\[dq] \[rs]"
452 .B "  type=\[dq]\[dq]image/png\[dq]\[dq] \[rs]"
453 .B "  href=\[dq]\[dq]http://foo.org//bar.png\[dq]\[dq]/>\[dq]"
455 .ft P
459 .B .HTML
460 All text after this macro is treated as raw html.
461 If the document is processed without
462 .B \-Thtml
464 .B \-Txhtml
465 then the macro is ignored.
466 Internally, this macro is used as a building block for other higher-level
467 macros.
469 For example, the
470 .B BGIMG
471 macro is defined as
475 .ft B
476 \&.de BGIMG
477 \&.   HTML <body background=\[rs]$1>
478 \&..
479 .ft P
484 .B .DC l text [color]
485 Produce a drop capital.
486 The first parameter is the letter to be dropped and enlarged, the second
487 parameter
488 .B text
489 is the ajoining text whose height the first letter should not exceed.
490 The optional third parameter is the color of the dropped letter.
491 It defaults to black.
494 .B ".CDS"
495 Start displaying a code section in constant width font.
498 .B ".CDE"
499 End code display
502 .B ".ALN [color] [percentage]"
503 Place section heading links automatically to the left of the main text.
504 The color argument is optional and if present indicates which HTML
505 background color is to be used under the links.
506 The optional percentage indicates the amount of width to devote to
507 displaying the links.
508 The default values are #eeeeee and 30 for color and percentage width,
509 respectively.
510 This macro should only be called once at the beginning of the document.
511 After calling this macro each section heading emits an HTML table consisting
512 of the links in the left and the section text on the right.
515 .B ".LNS"
516 Start a new two-column table with links in the left column.
517 This can be called if the document has text before the first .SH and if .ALN
518 is used.
519 Typically this is called just before the first paragraph and after the main
520 title as it indicates that text after this point should be positioned to the
521 right of the left-hand navigational links.
524 .B ".LNE"
525 End a two-column table.
526 This should be called at the end of the document if .ALN was used.
529 .B ".LINKSTYLE color [ fontstyle [ openglyph closeglyph ] ]"
530 Initialize default url attributes to be used if this macro set is not used
531 with the HTML device.
532 The macro set initializes itself with the following call
536 .ft B
537 \&.LINKSTYLE blue C \e[la] \e[ra]
538 .ft P
542 but these values will be superseded by a user call to LINKSTYLE.
544 .SH SECTION HEADING LINKS
545 By default
546 .B \%grohtml
547 generates links to all section headings and places these at the top of the
548 html document. (See
549 .URL #LK LINKS
550 for details of how to switch this off or alter the position).
553 .SH LIMITATIONS OF GROHTML
555 .B tbl
556 information is currently rendered as a PNG image.
559 .SH FILES
560 @MACRODIR@/www.tmac
563 .SH "SEE ALSO"
564 .BR groff (@MAN1EXT@),
565 .BR @g@troff (@MAN1EXT@)
566 .BR \%grohtml (@MAN1EXT@),
567 .BR netpbm (1)
570 .SH AUTHOR
571 .B \%grohtml
572 was written by
573 .MTO gaius@glam.ac.uk "Gaius Mulley"
576 .SH BUGS
577 Report bugs to the
578 .MTO bug-groff@\:gnu.org "Groff Bug Mailing List" .
579 Include a complete, self-contained example that will allow the bug to be
580 reproduced, and say which version of groff you are using.
582 .cp \n[groff_www_C]
584 .\" Local Variables:
585 .\" mode: nroff
586 .\" End: