diff options
Diffstat (limited to 'tmac')
-rw-r--r-- | tmac/groff_www.man | 43 | ||||
-rw-r--r-- | tmac/www.tmac | 178 |
2 files changed, 135 insertions, 86 deletions
diff --git a/tmac/groff_www.man b/tmac/groff_www.man index efc07e3e..3f6f2e96 100644 --- a/tmac/groff_www.man +++ b/tmac/groff_www.man @@ -1,5 +1,5 @@ .TH GROFF_WWW @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@" -.\" Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 +.\" Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 .\" Free Software Foundation, Inc. .\" Written by Gaius Mulley (gaius@glam.ac.uk) .\" @@ -52,7 +52,7 @@ The manual page is very a basic guide, and the html device driver has been completely rewritten but still remains as in an alpha state. It has been included into the distribution so that a lot of people have a chance to test it. -Note that this macro file will be automatically called (via the +Note that this macro file is automatically called (via the .B troffrc file) if you use .BR \-Thtml . @@ -99,9 +99,9 @@ Here is a summary of the functions found in this macro set. \&.CDE code example end \&.ALN place links on left of main text. -\&.LNS start a new two column +\&.LNS start a new two-column table with links in the left. -\&.LNE end the two column table. +\&.LNE end the two-column table. .fi .PP Output of the @@ -142,7 +142,7 @@ Whereas .fi .RE .IP -will tell +tells .B \%grohtml that no heading links should be created at all. Another method for turning automatic headings off is by issuing the @@ -487,30 +487,31 @@ End code display . .TP .B ".ALN [color] [percentage]" -Place section heading links automatically to the left of the main -text. The color argument is optional and if present indicates which -HTML background color is to be used under the links. +Place section heading links automatically to the left of the main text. +The color argument is optional and if present indicates which HTML +background color is to be used under the links. The optional percentage indicates the amount of width to devote to -displaying the links. The default values are #eeeeee and 30 -for color and percentage width respectively. +displaying the links. +The default values are #eeeeee and 30 for color and percentage width, +respectively. This macro should only be called once at the beginning of the document. -Once this macro has been called each section heading will emit an -HTML table consisting of the links in the left and the section text -on the right. +After calling this macro each section heading emits an HTML table consisting +of the links in the left and the section text on the right. . .TP .B ".LNS" -Start a new two column table with links in the left column. -This can be called if the document has text before the first .SH -and if .ALN is used. Typically this is called just before the -first paragraph and after the main title as it indicates that -text after this point should be positioned to the right of -the left hand navigational links. +Start a new two-column table with links in the left column. +This can be called if the document has text before the first .SH and if .ALN +is used. +Typically this is called just before the first paragraph and after the main +title as it indicates that text after this point should be positioned to the +right of the left-hand navigational links. . .TP .B ".LNE" -End a two column table. This should be called at the end of the -document if .ALN was used. +End a two-column table. +This should be called at the end of the document if .ALN was used. +. . .SH SECTION HEADING LINKS By default diff --git a/tmac/www.tmac b/tmac/www.tmac index 0e3c76fe..331838cf 100644 --- a/tmac/www.tmac +++ b/tmac/www.tmac @@ -38,6 +38,7 @@ A simple set of macros to provide HTML documents with basic www functionality. It should work with any macro set. .. . +. .\" -------------------------------------------------------------------- .\" Setup .\" -------------------------------------------------------------------- @@ -119,7 +120,6 @@ www functionality. It should work with any macro set. . el .sp \\n[www:pd]u .. . -.\" .\" -------------------------------------------------------------------- .\" www:error (<test>...) .\" @@ -145,6 +145,7 @@ www functionality. It should work with any macro set. . nr \\$1 (\\n[\\$0:n]-1) . rr \\$0:n .. +. .\" -------------------------------------------------------------------- .\" www:splitstr (<name>) .\" @@ -180,6 +181,7 @@ www functionality. It should work with any macro set. . rm \\$0:r . rm \\$0:s .. +. .\" -------------------------------------------------------------------- .\" www:url_breaks (<string_name>) .\" @@ -200,6 +202,7 @@ www functionality. It should work with any macro set. . ds \\$1 "\\*[\\$0:s]\"" . rm \\$0:s .. +. .\" -------------------------------------------------------------------- .\" www:url_breaks_splitted (<result> <char> [<char>...]) .\" @@ -256,6 +259,8 @@ www functionality. It should work with any macro set. . rm \\$0:res . rm \\$0:s .. +. +. .\" -------------------------------------------------------------------- .\" User Interface .\" -------------------------------------------------------------------- @@ -277,12 +282,14 @@ www functionality. It should work with any macro set. . nop \& . \} .. +. .\" .\" an auxiliary macro for HTML (without following space) .\" .de HTML-NS . nop \X^html:\\$*^\c .. +. .\" .\" emit a HTML tag after shutting down a (possibly open) paragraph .\" @@ -292,6 +299,7 @@ www functionality. It should work with any macro set. . nop \&\X^html</p>:\\$*^ . \} .. +. .\" -------------------------------------------------------------------- .\" HX n .\" @@ -305,18 +313,21 @@ www functionality. It should work with any macro set. . if \\n[www-html] \ . nop \X^index:\\$*^ .. +. .\" -------------------------------------------------------------------- .\" BCL foreground background active not-visited visited .\" .de BCL . HTML <body text=\\$1 bgcolor=\\$2 link=\\$3 alink=\\$4 vlink=\\$5> .. +. .\" -------------------------------------------------------------------- .\" BGIMG imagefile .\" .de BGIMG . HTML <body background=\\$1> .. +. .\" -------------------------------------------------------------------- .\" URL url [description] [after] .\" if description is absent then the url becomes the anchor text @@ -370,12 +381,14 @@ www functionality. It should work with any macro set. . \} . rm \\$0:adr .. +. .\" -------------------------------------------------------------------- .\" FTP url description [after] .\" .\" Same as URL. .\" .als FTP URL +. .\" -------------------------------------------------------------------- .\" MTO address description [after] .\" @@ -428,6 +441,7 @@ www functionality. It should work with any macro set. . \} . \} .. +. .\" -------------------------------------------------------------------- .\" TAG name .\" @@ -436,6 +450,7 @@ www functionality. It should work with any macro set. .de TAG . HTML <a name="\\$1"></a> .. +. .\" -------------------------------------------------------------------- .\" IMG [-R|-L|-C] filename [width] [height] .\" @@ -467,6 +482,7 @@ www functionality. It should work with any macro set. . el \ . nop \[la]\f[C]\\$1\f[]\[ra] .. +. .\" -------------------------------------------------------------------- .\" PIMG [-R|-L|-C] filename [width] [height] .\" @@ -577,7 +593,7 @@ www functionality. It should work with any macro set. .\" N1 - name of number register 1=absolute 0=percentage .\" N2 - number register name for absolute value .\" S1 - string register name for percentage value -. +.\" .de www-handle-percent . ds www-percent \\$1\" . substring www-percent -1 -1 @@ -612,7 +628,6 @@ www functionality. It should work with any macro set. .\" activating unsafe mode, if not used with -Thtml; the PNG image .\" is then converted to the EPS format using netpbm utilities. .\" -. .nr www-htmlimage-gap 0 . .de MPIMG @@ -751,6 +766,7 @@ www functionality. It should work with any macro set. . \} . \} .. +. .\" -------------------------------------------------------------------- .\" HnS n .\" @@ -779,6 +795,7 @@ www functionality. It should work with any macro set. . www-error "HnE found without a corresponding HnS" . DEVTAG-EO-H .. +. .\" -------------------------------------------------------------------- .\" LK .\" @@ -788,6 +805,7 @@ www functionality. It should work with any macro set. .de LK . DEVTAG ".links" .. +. .\" -------------------------------------------------------------------- .\" HR .\" @@ -796,6 +814,7 @@ www functionality. It should work with any macro set. .de HR . HTML</p> "<hr>" .. +. .\" -------------------------------------------------------------------- .\" NHR .\" @@ -805,6 +824,7 @@ www functionality. It should work with any macro set. .de NHR . DEVTAG ".no-auto-rule" .. +. .\" .\" www-end-nowhere - end of input trap called to finish diversion. .\" @@ -813,6 +833,7 @@ www functionality. It should work with any macro set. . di . DEVTAG-EO-TL .. +. .\" -------------------------------------------------------------------- .\" HTL .\" @@ -906,6 +927,7 @@ www functionality. It should work with any macro set. . if (\\n[www-ol-level] > 3) \ . www-error "OLS: too many levels of indentation (\\n[www-ol-level])" .. +. .\" .\" Auxiliary macro for OLE. .\" @@ -929,6 +951,7 @@ www functionality. It should work with any macro set. . nr www-li-indent +\w'\\*[www-ul-level\\n[www-ul-level]]'u . \} .. +. .\" -------------------------------------------------------------------- .\" ULE .\" @@ -944,6 +967,7 @@ www functionality. It should work with any macro set. . www-pop-ul-level . www-pop-li .. +. .\" -------------------------------------------------------------------- .\" OLS .\" @@ -957,6 +981,7 @@ www functionality. It should work with any macro set. . el \ . nr www-li-indent +\w'\\*[www-ol-tmp]'u .. +. .\" -------------------------------------------------------------------- .\" OLE .\" @@ -973,6 +998,7 @@ www functionality. It should work with any macro set. . www-pop-ol-level . www-pop-li .. +. .\" -------------------------------------------------------------------- .\" .\" DLS @@ -988,6 +1014,7 @@ www functionality. It should work with any macro set. . in \\n[www-li-indent]u . \} .. +. .\" -------------------------------------------------------------------- .\" .\" DLE @@ -1003,6 +1030,7 @@ www functionality. It should work with any macro set. . nr www-dl-level -1 . www-pop-li .. +. .\" -------------------------------------------------------------------- .\" LI .\" @@ -1021,6 +1049,7 @@ www functionality. It should work with any macro set. . nop \\*[www-ul-level\\n[www-ul-level]]\c . \} .. +. .\" ******** .\" www-li-ol - numbered list item .\" @@ -1034,6 +1063,7 @@ www functionality. It should work with any macro set. . nop \\n+[www-ol-ctr\\n[www-ol-level]]\ \ \c . \} .. +. .\" ******** .\" www-li-dl - definition list item .\" @@ -1050,6 +1080,7 @@ www functionality. It should work with any macro set. . br . \} .. +. .\" -------------------------------------------------------------------- .\" DC l text [color] .\" @@ -1064,7 +1095,7 @@ www functionality. It should work with any macro set. . ds www-dropcolor black . if !'\\$3'' \ . ds www-dropcolor \\$3 -. ie '\*(.T'html' \{\ +. ie '\*[.T]'html' \{\ . www-make-unique-name . nr www-drop-width (100u * \\n[.v]u * 3u / \\n[.l]u) . MPIMG -L \\*[www-unique-name].png "\\n[www-drop-width]%" @@ -1100,6 +1131,7 @@ www functionality. It should work with any macro set. . \} . nop \\$2 .. +. .\" -------------------------------------------------------------------- .\" Setup around HTML-IMAGE and friends .\" @@ -1109,6 +1141,7 @@ www functionality. It should work with any macro set. .do if !d TE .do ds TE HTML-IMAGE-END .do if !d EQ .do ds EQ HTML-IMAGE .do if !d EN .do ds EN HTML-IMAGE-END +. .\" .\" supplementary macros used by other macro sets .\" @@ -1125,6 +1158,7 @@ www functionality. It should work with any macro set. . if \\n[www-html] \ . nop \O[5\\$2\\$1.png]\O[0]\O[3] .. +. .\" -------------------------------------------------------------------- .\" HTML-IMAGE-END - terminates an image for html .\" @@ -1145,6 +1179,7 @@ www functionality. It should work with any macro set. . nr www-png-no +1 . ds www-unique-name \\*[www-image-template]\\n[www-png-no] .. +. .\" -------------------------------------------------------------------- .\" HTML-IMAGE and friends tell grohtml that this region of text needs .\" to be rendered as an image. @@ -1180,6 +1215,7 @@ www functionality. It should work with any macro set. .de JOBNAME . DEVTAG .job-name \\$1 .. +. .\" -------------------------------------------------------------------- .\" HEAD .\" @@ -1189,103 +1225,115 @@ www functionality. It should work with any macro set. .de HEAD . DEVTAG .head "\\$*" .. -.\" -------------------------------------------------------------------- -.\" Final Setup -.\" -------------------------------------------------------------------- -. -.if \n[www-html] \{\ -. nh -. nr HY 0 -.\} . -.\" +.\" -------------------------------------------------------------------- .\" start of some code .\" -. .de CDS -.ft C -.nf +. ft C +. nf .. -.\" +. +.\" -------------------------------------------------------------------- .\" end of some code .\" -. .de CDE -.fi -.ft P +. fi +. ft P .. . .ds www-nav-colour "#eeeeee .nr www-nav-width-left 30 .nr www-nav-width-right 70 . -. +.\" -------------------------------------------------------------------- .\" LNS - left navigation start -. +.\" .de LNS -. HTML</p> "<table><tr><td valign=top width=\\n[www-nav-width-left]% bgcolor=""\\*[www-nav-colour]"">" -. LK -. HTML</p> "</td><td valign=top width=\\n[www-nav-width-right]%>" -. nr SH-open 1 +. HTML</p> "<table><tr><td valign=top \ + width=\\n[www-nav-width-left]% \ + bgcolor=""\\*[www-nav-colour]"">" +. LK +. HTML</p> "</td><td valign=top width=\\n[www-nav-width-right]%>" +. nr SH-open 1 .. . +.\" -------------------------------------------------------------------- .\" LNE - left navigation end -. +.\" .de LNE -. HTML</p> </td></tr></table> -. HR +. HTML</p> </td></tr></table> +. HR .. +. .nr SH-open 0 .nr needs-begin 0 . -. +.\" +.\" some auxiliary macros for left navigation lists +.\" .de www-SH -. if (0\\$1 == 0) \{\ -. if (\\n[SH-open] == 1) .LNE -. nr needs-begin 1 -. @SH-old -. \} +. if (0\\$1 == 0) \{\ +. if (\\n[SH-open] == 1) \ +. LNE +. nr needs-begin 1 +. @SH-old +. \} .. . .de www-NH -. if (0\\$1 <= 1) \{\ -. if (\\n[SH-open] == 1) .LNE -. nr needs-begin 1 -. @NH-old -. \} +. if (0\\$1 <= 1) \{\ +. if (\\n[SH-open] == 1) \ +. LNE +. nr needs-begin 1 +. @NH-old +. \} .. . .de www-LP -. @LP-old -. if (\\n[needs-begin] == 1) \{\ -. HR -. LNS -. \} -. nr needs-begin 0 +. @LP-old +. if (\\n[needs-begin] == 1) \{\ +. HR +. LNS +. \} +. nr needs-begin 0 .. . -.\" ALN [colour] [left width percentage] -.\" turns on automatic left navigation, this macro should only be -.\" called once (normally at the start of the document) as it -.\" indicates the all top level section headings will form a -.\" navigation list on the left of the main text. -. +.\" -------------------------------------------------------------------- +.\" ALN [colour] [left width percentage] +.\" +.\" Turn on automatic left navigation. This macro should only be +.\" called once (normally at the start of the document) as it +.\" indicates that all top-level section headings form a navigation +.\" list on the left of the main text. +.\" .de ALN -. if '\*(.T'html' \{\ -. if !'\\$1'' .ds www-nav-colour \\$1 -. if (0\\$2 > 0) \{\ -. nr www-nav-width-left \\$2 -. nr www-nav-width-right (100-\\$2) -. \} -. rn @SH @SH-old -. rn www-SH @SH -. rn @NH @NH-old -. rn www-NH @NH -. rn @LP @LP-old -. rn www-LP @LP -. \} +. if '\*[.T]'html' \{\ +. if !'\\$1'' \ +. ds www-nav-colour \\$1 +. if (0\\$2 > 0) \{\ +. nr www-nav-width-left \\$2 +. nr www-nav-width-right (100 - \\$2) +. \} +. rn @SH @SH-old +. rn www-SH @SH +. rn @NH @NH-old +. rn www-NH @NH +. rn @LP @LP-old +. rn www-LP @LP +. \} .. . +. +.\" -------------------------------------------------------------------- +.\" Final Setup +.\" -------------------------------------------------------------------- +. +.if \n[www-html] \{\ +. nh +. nr HY 0 +.\} +. .if r ps4html .nop \O[0] .cp \n(_C . |