From 907c3a48e79ec146a4954c76c453cdbe6625a497 Mon Sep 17 00:00:00 2001 From: wl Date: Sat, 4 Oct 2008 21:24:37 +0000 Subject: * tmac/andoc.tmac: Rewritten, based on a preliminary version from Tadziu Hoffmann. It can now process multiple man pages with both man and mdoc formats intermixed. * NEWS, tmaca/groff_man.man, tmac/groff_mdoc.man, man/groff_tmac.man: Document it. --- tmac/an-old.tmac | 4 +++ tmac/andoc.tmac | 83 ++++++++++++++++++++++++++++++++++++++++++++++------- tmac/groff_man.man | 3 +- tmac/groff_mdoc.man | 3 +- 4 files changed, 80 insertions(+), 13 deletions(-) (limited to 'tmac') diff --git a/tmac/an-old.tmac b/tmac/an-old.tmac index 536094c2..c686731f 100644 --- a/tmac/an-old.tmac +++ b/tmac/an-old.tmac @@ -127,6 +127,10 @@ . nr an-margin \\n[IN] .. . +.ds an-extra1 +.ds an-extra2 +.ds an-extra3 +. .\" .TH title section extra1 extra2 extra3 .de1 TH . if \\n[an-html] \{\ diff --git a/tmac/andoc.tmac b/tmac/andoc.tmac index bfb869ab..5b938b42 100644 --- a/tmac/andoc.tmac +++ b/tmac/andoc.tmac @@ -1,19 +1,80 @@ .\" andoc.tmac .\" -.\" Load either an-old.tmac or doc.tmac. -.if !\n(.g .ab These macros require groff. -.de Dd -.rm Dd -.do mso doc.tmac -\\*(Dd\\ +.\" Load either an-old.tmac or doc.tmac. Multiple man pages can be +.\" handled. +.\" +.\" +.\" Copyright (C) 1991, 1995, 2000, 2002, 2008 +.\" Free Software Foundation, Inc. +.\" Written by James Clark (jjc@jclark.com) +.\" +.\" This file is part of groff. +.\" +.\" groff is free software; you can redistribute it and/or modify it under +.\" the terms of the GNU General Public License as published by the Free +.\" Software Foundation; either version 2, or (at your option) any later +.\" version. +.\" +.\" groff is distributed in the hope that it will be useful, but WITHOUT ANY +.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" for more details. +.\" +.\" You should have received a copy of the GNU General Public License along +.\" with groff; see the file COPYING. If not, write to the Free Software +.\" Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. +.\" +. +.if !\n(.g \ +. ab These macros require groff. +. +.nr _C \n(.C +.cp 0 +. +.als andoc-em em +.als andoc-bp bp +. +.de1 reload-doc +. ch an-header \" remove trap set by an-old.tmac +. ch an-footer \" remove trap set by an-old.tmac +. ch an-p-footer \" remove trap set by an-old.tmac +. +. als em andoc-em +. als bp andoc-bp +. rm Dd \" disable load-only-once, see doc.tmac +. +. mso doc.tmac +. +. ds str-dfp NAME\" this triggers setup-header +. als TH reload-man +\\*[Dd]\\ .. -.de TH -.rm TH -.do mso an-old.tmac -\\*(TH\\ +. +.de1 reload-man +. ch header \" remove trap set by doc.tmac +. ch footer \" remove trap set by doc.tmac +. +. als em andoc-em +. als bp andoc-bp +. rm RI \" disable load-only-once, see an-old.tmac +. blm \" no blank line macro +. rm TH +. +. mso an-old.tmac +. +. als Dd reload-doc +\\*[TH]\\ .. -.\" dummy equation macros -- eqnrc is read before .TH or .Dd is parsed. +. +.als TH reload-man +.als Dd reload-doc +. +.\" dummy equation macros -- eqnrc is read before .TH or .Dd is parsed .de EQ .. .de EN .. +. +.cp \n[_C] +. +.\" end of andoc.tmac diff --git a/tmac/groff_man.man b/tmac/groff_man.man index fee8a48e..c3892102 100644 --- a/tmac/groff_man.man +++ b/tmac/groff_man.man @@ -1068,11 +1068,12 @@ These are wrapper files to call . .TP .B andoc.tmac -This file checks whether the +Use this file in case you don't know whether the .B man macros or the .B mdoc package should be used. +Multiple man pages (in either format) can be handled. . .TP .B an-old.tmac diff --git a/tmac/groff_mdoc.man b/tmac/groff_mdoc.man index 50ca686f..3812c335 100644 --- a/tmac/groff_mdoc.man +++ b/tmac/groff_mdoc.man @@ -4088,11 +4088,12 @@ Definitions used for all other devices. .It Pa mdoc.local Local additions and customizations. .It Pa andoc.tmac -This file checks whether the +Use this file if you don't know whether the .Nm \-mdoc or the .Nm \-man package should be used. +Multiple man pages (in either format) can be handled. .El . . -- cgit v1.2.1