Sync-to-go: update copyright for 2015
[s-roff.git] / man / tmac-www.7.in
blobdc90532f8b23985042381eef5732ef057e070073
1 .\"@ @L_ROFF@_www.7
2 .\"
3 .\" Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
4 .\"
5 .\" Copyright (C) 2000 - 2006, 2008
6 .\" Free Software Foundation, Inc.
7 .\"      Written by Gaius Mulley (gaius@glam.ac.uk)
8 .\"
9 .\" This is free software; you can redistribute it and/or modify it under
10 .\" the terms of the GNU General Public License as published by the Free
11 .\" Software Foundation; either version 2, or (at your option) any later
12 .\" version.
13 .\"
14 .\" This is distributed in the hope that it will be useful, but WITHOUT ANY
15 .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 .\" for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public License along
20 .\" with groff; see the file COPYING.  If not, write to the Free Software
21 .\" Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
22 .\"
23 .\" user level guide to using the -mwww macroset
24 .\"
26 .TH @U_ROFF@_WWW @MAN7EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
28 .do nr groff_www_C \n[.C]
29 .cp 0
31 .do mso www.tmac
33 .\" we need the .LK here as we use it in the middle as an example --
34 .\" once the user requests .LK then the automatic generation of links
35 .\" at the top of the document is suppressed.
36 .LK
38 .\"
39 .SH NAME
41 @L_ROFF@_www \- @T_ROFF@ macros for authoring web pages
42 .HR
44 .\"
45 .SH SYNOPSIS
47 .B "@L_ROFF@ \-mwww"
48 [ options ]
49 file ...
51 .\"
52 .SH DESCRIPTION
54 This manual page describes the GNU \-mwww macro package, which is part of
55 the @T_ROFF@ document formatting system.
56 The manual page is very a basic guide, and the html device driver
57 .RB ( \%@L_DEV_HTML@ )
58 has been completely rewritten but still remains as in an alpha state.
59 It has been included into the distribution so that a lot of people have a
60 chance to test it.
61 Note that this macro file is automatically called (via the
62 .B troffrc
63 file) if you use
64 .B \-Thtml
66 .BR \-Txhtml .
68 .PP
69 To see the hyperlinks in action, please format this man page with the
70 .B \%@L_DEV_HTML@
71 device.
73 .PP
74 Here is a summary of the functions found in this macro set.
75 .TS
76 tab(@);
77 l l.
78 \&.JOBNAME@split output into multiple files
79 \&.HX@automatic heading level cut off
80 \&.BCL@specify colours on a web page
81 \&.BGIMG@specify background image
82 \&.URL@create a url using two parameters
83 \&.FTP@create an ftp reference
84 \&.MTO@create a html email address
85 \&.FTP@create an ftp reference
86 \&.TAG@generate an html name
87 \&.IMG@include an image file
88 \&.PIMG@include png image
89 \&.MPIMG@place png on the margin and wrap text around it
90 \&.HnS@begin heading
91 \&.HnE@end heading
92 \&.LK@emit automatically collected links.
93 \&.HR@produce a horizontal rule
94 \&.NHR@suppress automatic generation of rules.
95 \&.HTL@only generate HTML title
96 \&.HEAD@add data to <head> block
97 \&.ULS@unorder list begin
98 \&.ULE@unorder list end
99 \&.OLS@ordered list begin
100 \&.OLE@ordered list end
101 \&.DLS@definition list begin
102 \&.DLE@definition list end
103 \&.LI@insert a list item
104 \&.DC@generate a drop capital
105 \&.HTML@pass an html raw request to the device driver
106 \&.CDS@code example begin
107 \&.CDE@code example end
108 \&.ALN@place links on left of main text.
109 \&.LNS@start a new two-column table with links in the left.
110 \&.LNE@end the two-column table.
111 \&.LINKSTYLE@initialize default url attributes.
115 Output of the
116 .BR @L_P_PIC@ ,
117 .BR @L_P_EQN@ ,
118 .BR @L_P_REFER@ ,
120 .B @L_P_TBL@
121 preprocessors is acceptable as input.
124 .SH REQUESTS
127 .B .JOBNAME filename
128 Split output into multiple HTML files.
129 A file is split whenever a .SH or .NH\ 1 is encountered.
130 Its argument is the file stem name for future output files.
131 This option is equivalent to
132 .BR \%@L_DEV_HTML@ 's
133 .B \-j
134 option.
137 .B .HX n
138 Specify the cut off depth when generating links from section headings.
139 For example, a parameter of\~2 would cause
140 .B \%@L_DEV_HTML@
141 to generate a list of links for
142 .B .NH\ 1
144 .B .NH\ 2
145 but not for
146 .BR .NH\ 3 .
147 Whereas
151 .B .HX 0
156 tells
157 .B \%@L_DEV_HTML@
158 that no heading links should be created at all.
159 Another method for turning automatic headings off is by issuing the
160 the command line switch
161 .B \-P\-l
163 .BR @L_ROFF@ .
166 .B .BCL foreground background active not-visited visited
167 This macro takes five parameters: foreground, background, active hypertext
168 link, hypertext link not yet visited, and visited hypertext link colour.
171 .B .BGIMG imagefile
172 the only parameter to this macro is the background image file.
175 .B .URL url [description] [after]
176 generates
177 .TAG URL
178 a URL using either one, two or three arguments.
179 The first parameter is the actual URL, the second is the name of the link,
180 and the third is optional stuff to be printed immediately afterwards.
182 .B description
184 .B after
185 are absent then the
186 .B url
187 becomes the anchor text.
188 Hyphenation is disabled while printing the actual URL;
189 explicit breakpoints
190 should be inserted with the
191 .B \[rs]:
192 escape.
193 Here is how to encode
194 .URL http://\:foo.\:org/ "foo" :
197 .B .URL http://\[rs]:foo.\[rs]:org/ "foo" :
200 If this is processed by a device other than
201 .B \-Thtml
203 .B \-Txhtml
204 it appears as:
208 foo \[la]\f[C]http://foo.org\f[]\[ra]:
212 The URL macro can be of any type; for example we can reference
213 .URL pic.html "Eric Raymond's pic guide"
218 .B .URL pic.html \[dq]Eric Raymond's pic guide\[dq]
222 .B .MTO address [description] [after]
223 Generate an email html reference.
224 The first argument is mandatory as the email address.
225 The optional second argument is the text you see in your browser
226 If an empty argument is given,
227 .B address
228 is used instead.
229 An optional third argument is stuff printed immediately afterwards.
230 Hyphenation is disabled while printing the actual email address.
231 For example,
232 .MTO joe@user.org "Joe User"
233 was achieved by the following macro:
237 .B .MTO joe@user.org \[dq]Joe User\[dq]
241 Note that all the URLs actually are treated as consuming no textual space
242 in @L_ROFF@.
243 This could be considered as a bug since it causes some problems.
244 To circumvent this,
245 .B www.tmac
246 inserts a zero-width character which expands to a harmless space (only if
247 run with
248 .B \-Thtml
250 .BR \-Txhtml ).
253 .B .FTP url [description] [after]
254 indicates that data can be obtained via ftp.
255 The first argument is the url and the second is the browser text.
256 A third argument, similar to the macros above, is intended for stuff printed
257 immediately afterwards.
258 The second and the third parameter are optional.
259 Hyphenation is disabled while printing the actual URL.
260 As an example, here the location of the
261 .FTP ftp://\:ftp.gnu.org/ "GNU ftp server" .
262 The macro example above was specified by:
265 .B .FTP ftp://\[rs]:ftp.gnu.org/ \[dq]GNU ftp server\[dq] .
269 .B .TAG name
270 Generates an html name tag from its argument.
271 This can then be referenced using the
272 .URL #URL URL
273 macro.
274 As you can see, you must precede the tag name with
275 .B #
276 since it is a local reference.
277 This link was achieved via placing a TAG in the URL description above;
278 the source looks like this:
282 .ft B
283 \&.TP
284 \&.B URL
285 generates
286 \&.TAG URL
287 a URL using either two or three arguments.
288 \&.\|.\|.
290 .ft P
294 .B .IMG [-R|-L|-C] filename [width] [height]
295 Include a picture into the document.
296 The first argument is the horizontal location: right, left, or center
297 .RB ( \-R ,
298 .BR \-L ,
300 .BR \-C ).
301 Alignment is centered by default (-C).
302 The second argument is the filename.
303 The optional third and fourth arguments are the width and height.
304 If the width is absent it defaults to 1\~inch.
305 If the height is absent it defaults to the width.
306 This maps onto an html img tag.
307 If you are including a png image then it is advisable to use the
308 .B PIMG
309 macro.
312 .B .PIMG [-R|-L|-C] filename [width [height]]
313 Include an image in PNG format.
314 This macro takes exactly the same parameters as the
315 .B IMG
316 macro; it has the advantage of working with postscript and html devices
317 also since it can automatically convert the image into the EPS format,
318 using the following programs
319 of the
320 .B netpbm
321 package:
322 .BR pngtopnm ,
323 .BR pnmcrop ,
325 .BR pnmtops .
326 If the document isn't processed with
327 .B \-Thtml
329 .B \-Txhtml
330 it is necessary to use the
331 .B \-U
332 option of @L_ROFF@.
335 .B .MPIMG [-R|-L] [-G gap] filename [width [height]]
336 Place a PNG image on the margin and wrap text around it.
337 The first parameters are optional.
338 The alignment: left or right
339 .RB ( \-L
341 .BR \-R )
342 specifies the margin where the picture is placed at.
343 The default alignment is left
344 .RB ( -L ).
345 Optionally,
346 .BI \-G \~gap
347 can be used to arrange a gap between the picture
348 and the text that wraps around it.
349 The default gap width is zero.
351 The first non-optional argument is the filename.
352 The optional following arguments are the width and height.
353 If the width is absent it defaults to 1\~inch.
354 If the height is absent it defaults to the width.
355 Example:
359 .ft B
360 \&.MPIMG -L -G 2c foo.png 3c 1.5c
361 .ft P
365 The height and width may also be given as percentages. The PostScript
366 device calculates the width from the
367 .B .l
368 register and the height from the
369 .B .p
370 register. For example:
374 .ft B
375 \&.MPIMG -L -G 2c foo.png 15%
376 .ft P
381 .B .HnS n
382 Begin heading.
383 The numeric heading level
384 .I n
385 is specified by the first parameter.
386 Use this macro if your headings contain URL, FTP or MTO macros.
387 Example:
391 .ft B
392 \&.HnS 1
393 \&.HR
394 GNU Troff
395 \&.URL http://groff.ffii.org (Groff)
396 \&\(em a
397 \&.URL http://www.gnu.org/ GNU
398 \&project.
399 \&Hosted by
400 \&.URL http://ffii.org/ FFII .
401 \&.HR
402 \&.HnE
403 .ft P
407 In this case you might wish to
408 disable automatic links to headings.
409 This can be done via
410 .B \-P\-l
411 from the command line.
412 .\" or by using a call to `.HX 0'.
415 .B .HnE
416 End heading.
419 .B .LK
420 .TAG LK
421 Force \%@L_DEV_HTML@ to place the automatically generated links at this
422 position.
423 If this manual page has been processed with
424 .B \-Thtml
426 .B \-Txhtml
427 those links can be seen right here.
431 .B .HR
432 Generate a full-width horizontal rule for
433 .B \-Thtml
435 .BR \-Txhtml .
436 No effect for all other devices.
439 .B .NHR
440 Suppress generation of the top and bottom rules which \%grohtml emits
441 by default.
444 .B .HTL
445 Generate an HTML title only.
446 This differs from the
447 .B TL
448 macro of the
449 .B ms
450 macro package which generates both an HTML title and an <H1> heading.
451 Use it to provide an HTML title as search engine fodder but a graphic title
452 in the document.
453 The macro terminates when a space or break is seen (.sp, .br).
456 .B .HEAD
457 Add arbitrary HTML data to the <head> block.
458 Ignored if not processed with
459 .B \-Thtml
461 .BR \-Txhtml .
462 Example:
466 .B ".HEAD" "\[dq]<link \[rs]"
467 .B "  rel=\[dq]\[dq]icon\[dq]\[dq] \[rs]"
468 .B "  type=\[dq]\[dq]image/png\[dq]\[dq] \[rs]"
469 .B "  href=\[dq]\[dq]http://foo.org//bar.png\[dq]\[dq]/>\[dq]"
471 .ft P
475 .B .HTML
476 All text after this macro is treated as raw html.
477 If the document is processed without
478 .B \-Thtml
480 .B \-Txhtml
481 then the macro is ignored.
482 Internally, this macro is used as a building block for other higher-level
483 macros.
485 For example, the
486 .B BGIMG
487 macro is defined as
491 .ft B
492 \&.de BGIMG
493 \&.   HTML <body background=\[rs]$1>
494 \&..
495 .ft P
500 .B .DC l text [color]
501 Produce a drop capital.
502 The first parameter is the letter to be dropped and enlarged, the second
503 parameter
504 .B text
505 is the ajoining text whose height the first letter should not exceed.
506 The optional third parameter is the color of the dropped letter.
507 It defaults to black.
510 .B ".CDS"
511 Start displaying a code section in constant width font.
514 .B ".CDE"
515 End code display
518 .B ".ALN [color] [percentage]"
519 Place section heading links automatically to the left of the main text.
520 The color argument is optional and if present indicates which HTML
521 background color is to be used under the links.
522 The optional percentage indicates the amount of width to devote to
523 displaying the links.
524 The default values are #eeeeee and 30 for color and percentage width,
525 respectively.
526 This macro should only be called once at the beginning of the document.
527 After calling this macro each section heading emits an HTML table consisting
528 of the links in the left and the section text on the right.
531 .B ".LNS"
532 Start a new two-column table with links in the left column.
533 This can be called if the document has text before the first .SH and if .ALN
534 is used.
535 Typically this is called just before the first paragraph and after the main
536 title as it indicates that text after this point should be positioned to the
537 right of the left-hand navigational links.
540 .B ".LNE"
541 End a two-column table.
542 This should be called at the end of the document if .ALN was used.
545 .B ".LINKSTYLE color [ fontstyle [ openglyph closeglyph ] ]"
546 Initialize default url attributes to be used if this macro set is not used
547 with the HTML device.
548 The macro set initializes itself with the following call
552 .ft B
553 \&.LINKSTYLE blue C \e[la] \e[ra]
554 .ft P
558 but these values will be superseded by a user call to LINKSTYLE.
561 .SH SECTION HEADING LINKS
563 By default
564 .B \%@L_DEV_HTML@
565 generates links to all section headings and places these at the top of the
566 html document. (See
567 .URL #LK LINKS
568 for details of how to switch this off or alter the position).
571 .SH LIMITATIONS OF @U_DEV_HTML@
574 .B tbl
575 information is currently rendered as a PNG image.
578 .SH FILES
580 @MACRODIR@/www.tmac
583 .SH "SEE ALSO"
585 .BR \%@L_ROFF@ (@MAN1EXT@),
586 .BR \%@L_TROFF@ (@MAN1EXT@)
587 .BR \%@L_DEV_HTML@ (@MAN1EXT@)
590 .SH AUTHOR
592 .B \%@L_DEV_HTML@
593 was written by
594 .MTO gaius@glam.ac.uk "Gaius Mulley"
597 .SH BUGS
599 Report bugs to
600 .MTO @BUGMAIL@ .
602 .cp \n[groff_www_C]
604 .\" s-ts-mode