Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/notes/common Don't open-code .tm calls to emit TOC e...
details: https://anonhg.NetBSD.org/src/rev/2228a9626f56
branches: trunk
changeset: 465549:2228a9626f56
user: uwe <uwe%NetBSD.org@localhost>
date: Wed Nov 27 23:53:01 2019 +0000
description:
Don't open-code .tm calls to emit TOC entries.
Hide it in an .mktoc macro so that we can switch the way we generate
TOC more easily.
diffstat:
distrib/notes/common/macros | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diffs (48 lines):
diff -r c14f5bddd66d -r 2228a9626f56 distrib/notes/common/macros
--- a/distrib/notes/common/macros Wed Nov 27 23:19:13 2019 +0000
+++ b/distrib/notes/common/macros Wed Nov 27 23:53:01 2019 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: macros,v 1.46 2019/11/27 21:37:27 uwe Exp $
+.\" $NetBSD: macros,v 1.47 2019/11/27 23:53:01 uwe Exp $
.\"
.\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -310,15 +310,20 @@
.\" .Tc import the TOC
.\" .Ti depth page "item" (internal) output an entry
.if dTOC \{\
+.de mktoc
+.nr mktoc-level \\$1
+.shift
+.tm .Ti \\n[toc-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
@@ -326,13 +331,13 @@
.shift
.ie rHTML <a name="\\$*">\\$*</a>
.el \\$*
-.if dTOC .tm .Ti \\n[Te-toc-level] \\n% "\\$*"
+.if dTOC .mktoc \\n[Te-toc-level] \\$@
..
.de To
.nr To-toc-level \\$1
.shift
.if rHTML <a name="\\$*"></a>
-.if dTOC .tm .Ti \\n[To-toc-level] \\n% "\\$*"
+.if dTOC .mktoc \\n[To-toc-level] \\$@
..
.de Ti
.ie rHTML \{.ta (\n(.lu+\w'<a href="#\\$3"></a>'u)R
Home |
Main Index |
Thread Index |
Old Index