summaryrefslogtreecommitdiff
path: root/tmac
diff options
context:
space:
mode:
authorwl <wl>2008-10-04 21:24:37 +0000
committerwl <wl>2008-10-04 21:24:37 +0000
commit907c3a48e79ec146a4954c76c453cdbe6625a497 (patch)
tree8e2125e118713810bedd4bf9cecc072fa76cfa75 /tmac
parent2c4507c31fd3eb50aa2daf0a9e1478c46d0ab774 (diff)
downloadgroff-907c3a48e79ec146a4954c76c453cdbe6625a497.tar.gz
* 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.
Diffstat (limited to 'tmac')
-rw-r--r--tmac/an-old.tmac4
-rw-r--r--tmac/andoc.tmac83
-rw-r--r--tmac/groff_man.man3
-rw-r--r--tmac/groff_mdoc.man3
4 files changed, 80 insertions, 13 deletions
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
.
.