Merge branch 'topic/sync-to-go-2'
[s-roff.git] / man / tmac-www.7.in
blob8fd7b56f5f0c2d789163460f4390fa2d04e96927
1 .\"@ @L_ROFF@_www.7
2 .\"
3 .\" Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
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.
366 The PostScript device calculates the width from the
367 .B .l
368 register and the height from the
369 .B .p
370 register.
371 For example:
375 .ft B
376 \&.MPIMG \-L \-G 2c foo.png 15%
377 .ft P
382 .B .HnS n
383 Begin heading.
384 The numeric heading level
385 .I n
386 is specified by the first parameter.
387 Use this macro if your headings contain URL, FTP or MTO macros.
388 Example:
392 .ft B
393 \&.HnS 1
394 \&.HR
395 GNU Troff
396 \&.URL http://groff.ffii.org (Groff)
397 \&\(em a
398 \&.URL http://www.gnu.org/ GNU
399 \&project.
400 \&Hosted by
401 \&.URL http://ffii.org/ FFII .
402 \&.HR
403 \&.HnE
404 .ft P
408 In this case you might wish to
409 disable automatic links to headings.
410 This can be done via
411 .B \-P\-l
412 from the command line.
413 .\" or by using a call to `.HX 0'.
416 .B .HnE
417 End heading.
420 .B .LK
421 .TAG LK
422 Force \%@L_DEV_HTML@ to place the automatically generated links at this
423 position.
424 If this manual page has been processed with
425 .B \-Thtml
427 .B \-Txhtml
428 those links can be seen right here.
432 .B .HR
433 Generate a full-width horizontal rule for
434 .B \-Thtml
436 .BR \-Txhtml .
437 No effect for all other devices.
440 .B .NHR
441 Suppress generation of the top and bottom rules which \%grohtml emits
442 by default.
445 .B .HTL
446 Generate an HTML title only.
447 This differs from the
448 .B TL
449 macro of the
450 .B ms
451 macro package which generates both an HTML title and an <H1> heading.
452 Use it to provide an HTML title as search engine fodder but a graphic title
453 in the document.
454 The macro terminates when a space or break is seen (.sp, \&.br).
457 .B .HEAD
458 Add arbitrary HTML data to the <head> block.
459 Ignored if not processed with
460 .B \-Thtml
462 .BR \-Txhtml .
463 Example:
467 .B ".HEAD" "\[dq]<link \[rs]"
468 .B "  rel=\[dq]\[dq]icon\[dq]\[dq] \[rs]"
469 .B "  type=\[dq]\[dq]image/png\[dq]\[dq] \[rs]"
470 .B "  href=\[dq]\[dq]http://foo.org//bar.png\[dq]\[dq]/>\[dq]"
472 .ft P
476 .B .HTML
477 All text after this macro is treated as raw html.
478 If the document is processed without
479 .B \-Thtml
481 .B \-Txhtml
482 then the macro is ignored.
483 Internally, this macro is used as a building block for other higher-level
484 macros.
486 For example, the
487 .B BGIMG
488 macro is defined as
492 .ft B
493 \&.de BGIMG
494 \&.   HTML <body background=\[rs]$1>
495 \&..
496 .ft P
501 .B .DC l text [color]
502 Produce a drop capital.
503 The first parameter is the letter to be dropped and enlarged, the second
504 parameter
505 .B text
506 is the ajoining text whose height the first letter should not exceed.
507 The optional third parameter is the color of the dropped letter.
508 It defaults to black.
511 .B ".CDS"
512 Start displaying a code section in constant width font.
515 .B ".CDE"
516 End code display
519 .B ".ALN [color] [percentage]"
520 Place section heading links automatically to the left of the main text.
521 The color argument is optional and if present indicates which HTML
522 background color is to be used under the links.
523 The optional percentage indicates the amount of width to devote to
524 displaying the links.
525 The default values are #eeeeee and 30 for color and percentage width,
526 respectively.
527 This macro should only be called once at the beginning of the document.
528 After calling this macro each section heading emits an HTML table consisting
529 of the links in the left and the section text on the right.
532 .B ".LNS"
533 Start a new two-column table with links in the left column.
534 This can be called if the document has text before the first \&.SH and
535 if \&.ALN is used.
536 Typically this is called just before the first paragraph and after the main
537 title as it indicates that text after this point should be positioned to the
538 right of the left-hand navigational links.
541 .B ".LNE"
542 End a two-column table.
543 This should be called at the end of the document if \&.ALN was used.
546 .B ".LINKSTYLE color [ fontstyle [ openglyph closeglyph ] ]"
547 Initialize default url attributes to be used if this macro set is not used
548 with the HTML device.
549 The macro set initializes itself with the following call
553 .ft B
554 \&.LINKSTYLE blue C \e[la] \e[ra]
555 .ft P
559 but these values will be superseded by a user call to LINKSTYLE.
562 .SH SECTION HEADING LINKS
564 By default
565 .B \%@L_DEV_HTML@
566 generates links to all section headings and places these at the top of the
567 html document.
568 (See
569 .URL #LK LINKS
570 for details of how to switch this off or alter the position).
573 .SH LIMITATIONS OF @U_DEV_HTML@
576 .B tbl
577 information is currently rendered as a PNG image.
580 .SH FILES
582 @MACRODIR@/www.tmac
585 .SH "SEE ALSO"
587 .BR \%@L_ROFF@ (@MAN1EXT@),
588 .BR \%@L_TROFF@ (@MAN1EXT@)
589 .BR \%@L_DEV_HTML@ (@MAN1EXT@)
592 .SH AUTHOR
594 .B \%@L_DEV_HTML@
595 was written by
596 .MTO gaius@glam.ac.uk "Gaius Mulley"
599 .SH BUGS
601 Report bugs to
602 .MTO @BUGMAIL@ .
604 .cp \n[groff_www_C]
606 .\" s-ts-mode