Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/distrib/notes Pull up the following revisions, requested ...



details:   https://anonhg.NetBSD.org/src/rev/46a5f39e55d9
branches:  netbsd-9
changeset: 1001260:46a5f39e55d9
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Dec 09 13:00:22 2019 +0000

description:
Pull up the following revisions, requested by uwe in ticket #523:

        distrib/notes/Makefile.inc                      up to 1.52
        distrib/notes/common/macros                     up to 1.54

Improve table of contents.

diffstat:

 distrib/notes/Makefile.inc  |  32 +++++---------
 distrib/notes/common/macros |  94 ++++++++++++++++++++++++++++++++++++--------
 2 files changed, 89 insertions(+), 37 deletions(-)

diffs (197 lines):

diff -r 421a706e8466 -r 46a5f39e55d9 distrib/notes/Makefile.inc
--- a/distrib/notes/Makefile.inc        Mon Dec 09 12:55:16 2019 +0000
+++ b/distrib/notes/Makefile.inc        Mon Dec 09 13:00:22 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.43.18.4 2019/11/27 16:07:30 martin Exp $
+#      $NetBSD: Makefile.inc,v 1.43.18.5 2019/12/09 13:00:22 martin Exp $
 #
 
 # Ross Harvey <ross%NetBSD.org@localhost>
@@ -13,12 +13,13 @@
 M?=    ${.CURDIR:T}
 COMMON=        ${.CURDIR}/../common
 
-MAIN=  ${COMMON}/main ${COMMON}/macros ${EXTRA}
+MAIN=  ${COMMON}/main ${EXTRA}
 TARG=  INSTALL
 TARGS= ${TARG}.ps ${TARG}.txt ${TARG}.html ${TARG}.more
 TOCS=  ${TARG}.PostScript.toc ${TARG}.ASCII.toc ${TARG}.HTML.toc \
        ${TARG}.more.toc
-SRCS=  ${MAIN} whatis ${COMMON}/contents hardware xfer prep \
+SRCS=  ${MAIN} ${COMMON}/macros \
+       whatis ${COMMON}/contents hardware xfer prep \
        ${.CURDIR}/install ${COMMON}/postinstall upgrade \
        ${COMMON}/legal.common ${COMMON}/netboot \
        ${COMMON}/sysinst \
@@ -102,35 +103,26 @@
        ${TOOL_GROFF} ${ARGS_MORE} -mdoc      ${MAIN} > $@
 
 
-# Rules to build the table of contents (.toc) files.
-# They are generated twice to take into account the
-# space taken by the TOC itself.
-#
-
-TOCPROC=         2>&1 >/dev/null |\
-          ${TOOL_SED} -n -e 's/"//g' \
-          -e '/^\.Ti/{s/ \([A-Za-z]\)/ "\1/; s/ *$$/"/; p; }'
+# Rules to build the table of contents (.toc) files.  For the
+# PostScript version it's generated twice to take into account the
+# space taken by the TOC itself.  Other versions are not paginated.
 
 ${TARG}.PostScript.toc: ${SRCS}
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
+       ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} > /dev/null
        mv -f $@.tmp $@
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
+       ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} > /dev/null
        mv -f $@.tmp $@
 
 ${TARG}.ASCII.toc: ${SRCS}
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
-       mv -f $@.tmp $@
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
+       ${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} > /dev/null
        mv -f $@.tmp $@
 
 ${TARG}.HTML.toc: ${SRCS}
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
+       ${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} > /dev/null
        mv -f $@.tmp $@
 
 ${TARG}.more.toc: ${SRCS}
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
-       mv -f $@.tmp $@
-       ${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
+       ${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} > /dev/null
        mv -f $@.tmp $@
 
 
diff -r 421a706e8466 -r 46a5f39e55d9 distrib/notes/common/macros
--- a/distrib/notes/common/macros       Mon Dec 09 12:55:16 2019 +0000
+++ b/distrib/notes/common/macros       Mon Dec 09 13:00:22 2019 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: macros,v 1.43.6.1 2019/11/27 13:36:55 msaitoh Exp $
+.\"    $NetBSD: macros,v 1.43.6.2 2019/12/09 13:00:22 martin Exp $
 .\"
 .\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -309,42 +309,102 @@
 .\" XXX To should be unnecessary if we handle parseable/callable.
 .\"   .Tc                      import the TOC
 .\"   .Ti depth page "item"    (internal) output an entry
-.if dTOC \{
+.ds toc-file INSTALL.\*[format].toc
+.if dTOC \{\
+.tm ...writing \*[toc-file].tmp
+.open toc-tmp \*[toc-file].tmp
+.de mktoc
+.nr mktoc-level \\$1
+.shift
+.write toc-tmp .Ti \\n[mktoc-level] \\n% "\\$*"
+..
 .rn Ss Ss-toc
 .de Ss
 .Ss-toc \\$@
-.tm .Ti 0 \\n% "\\$*"
+.mktoc 0 \\$@
 ..
 .rn Ss2 Ss2-toc
 .de Ss2
 .Ss2-toc \\$@
-.tm .Ti 1 \\n% "\\$*"
+.mktoc 1 \\$@
 ..
 .\}
 .de Te
-.ie rHTML <a name="\\$2">\\$2</a>
-.el \\$2
-.if dTOC \.tm .Ti \\$1 \\n% \\$2
+.nr Te-toc-level \\$1
+.shift
+.ie rHTML <a name="\\$*">\\$*</a>
+.el \\$*
+.if dTOC .mktoc \\n[Te-toc-level] \\$@
 ..
 .de To
-.if rHTML <a name="\\$2"></a>
-.if dTOC \.tm .Ti \\$1 \\n% \\$2
+.nr To-toc-level \\$1
+.shift
+.if rHTML <a name="\\$*"></a>
+.if dTOC .mktoc \\n[To-toc-level] \\$@
 ..
+.
+.\" .Tc and .Ti for PostScript
+.
+.ie '\*[format]'PostScript' \{\
 .de Ti
-.ie rHTML \{.ta (\n(.lu+\w'<a href="#\\$3"></a>'u)R
-\h'3n*\\$1u' <a href="#\\$3">\\$3</a>\a\\$2
+.nr Ti-toc-level \\$1
+.nr Ti-page \\$2
+.shift 2
+.nr Ti-indent (\\n[Tc-saved-indent]+(3n*\\n[Ti-toc-level]))
+.in \\n[Ti-indent]u
+\\$* \c
+'nr Ti-eol-pos (\\n(.l-\\n(.i-\\n(.k)
+'ta (\\n[Ti-eol-pos]u-\w'099'u)R (\\n[Ti-eol-pos]u)R
+\a\t\\n[Ti-page]
+.br
+..
+.
+.de Tc
+.nr Tc-saved-indent \\n(.i
+.tm ...reading \*[toc-file]
+.\" Use so-real here because toc-file is in objdir not .CURDIR
+.so-real \*[toc-file]
+.in \\n[Tc-saved-indent]u
+..
 .\}
-.el \h'3n*\\$1u' \\$3\a\\$2
+.
+.\"  .Tc and .Ti for HTML
+.
+.el .ie rHTML \{\
+.de Ti
+.nr Ti-toc-level \\$1
+.\"nr Ti-page \\$2
+.shift 2
+\h'3n*\\n[Ti-toc-level]u' <a href="#\\$*">\\$*</a>
+..
+.
+.de Tc
+.tm ...reading \*[toc-file]
+.nf
+.\" Use so-real here because toc-file is in objdir not .CURDIR
+.so-real \*[toc-file]
+.fi
+..
+.\}
+.
+.\" .Tc and .Ti for unpaginated text
+.
+.el \{\
+.de Ti
+.nr Ti-toc-level \\$1
+.\"nr Ti-page \\$2
+.shift 2
+\h'3n*\\n[Ti-toc-level]u'\\$*
+.br
 ..
 .de Tc
 .Bd -literal
-.ta (\n(.lu)R
-\.tm ...reading INSTALL.\*[format].toc
-.       Pp
-.\" Use so-real here because otherwise we lose on objdirs
-\.so-real INSTALL.\*[format].toc
+.tm ...reading \*[toc-file]
+.\" Use so-real here because toc-file is in objdir not .CURDIR
+.so-real \*[toc-file]
 .Ed
 ..
+.\}
 .
 .
 .\"    --------------------  MISC  --------------------



Home | Main Index | Thread Index | Old Index