groff-commit
[Top][All Lists]
Advanced

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

[groff] 18/28: [man]: Add `an*bookmark-base-level` register.


From: G. Branden Robinson
Subject: [groff] 18/28: [man]: Add `an*bookmark-base-level` register.
Date: Mon, 4 Mar 2024 07:42:38 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 5fbc22d022c07f517bc83aa9b8c97ea5536efd18
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Mar 3 23:57:38 2024 -0600

    [man]: Add `an*bookmark-base-level` register.
    
    * tmac/an.tmac: Add experimental feature to support increasing the base
      level of PDF bookmarks.  Define register `an*bookmark-base-level`,
      initialized to zero.
    
      (PT): Add 1 to it when producing document bookmark.
    
      (SH): Add 2 to it when producing section heading bookmark.
    
      (SS): Add 3 to it when producing subsection heading bookmark.
---
 ChangeLog    |  9 +++++++++
 tmac/an.tmac | 13 ++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 52d96421f..0ffdd0403 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-03-03  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/an.tmac: Add experimental feature to support increasing
+       the base level of PDF bookmarks.  Define register
+       `an*bookmark-base-level`, initialized to zero.
+       (PT): Add 1 to it when producing document bookmark.
+       (SH): Add 2 to it when producing section heading bookmark.
+       (SS): Add 3 to it when producing subsection heading bookmark.
+
 2024-03-03  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [man]: Accept `MR` calls with only one argument.
diff --git a/tmac/an.tmac b/tmac/an.tmac
index cc063a25e..2b1789741 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -207,6 +207,10 @@
 .  ds an*section9 Kernel Developer's Manual\"
 ..
 .
+.\" Customize this at the command line to, for example, group multiple
+.\" man pages within a collection or containing document.
+.nr an*bookmark-base-level 0
+.
 .\" Write a bookmark/anchor/link target $2 at hierarchical depth $1.
 .de an*bookmark
 .  an*bookmark*\*[.T] \\$@
@@ -439,7 +443,8 @@
 .  \" Attach a bookmark to the page header on the first page of a new
 .  \" man(7) document; a changed identifier and section indicates this.
 .  if !'\\*[an*page-ref-string]'\\*[an*previous-page-ref-string]' \{\
-.    an*bookmark 1 "\\*[an*page-ref-string]"
+.    nr an*bookmark-level (\\n[an*bookmark-base-level] + 1)
+.    an*bookmark \\n[an*bookmark-level]  "\\*[an*page-ref-string]"
 .    ds an*previous-page-ref-string "\\*[an*page-ref-string]
 .  \}
 .  tl '\\*[an-pageref]'\\*[an-extra3]'\\*[an-pageref]'
@@ -731,7 +736,8 @@ contains unsupported escape sequence
 .    ds an-section-heading \\$*\"
 .    if \\n[CS] \
 .      stringup an-section-heading
-.    an*bookmark 2 "\\*[an-section-heading]"
+.    nr an*bookmark-level (\\n[an*bookmark-base-level] + 2)
+.    an*bookmark \\n[an*bookmark-level] "\\*[an-section-heading]"
 .    nop \&\\*[an-section-heading]
 .  if \\n[an-remap-I-style-in-headings] .ftr I I
 ..
@@ -756,7 +762,8 @@ contains unsupported escape sequence
 .  if \\n[an-remap-I-style-in-headings] .ftr I \\*[an-heading-family]BI
 .  if \\n[.$] \{\
 .    ds an*subsection-heading \\$*\"
-.    an*bookmark 3 "\\*[an*subsection-heading]"
+.    nr an*bookmark-level (\\n[an*bookmark-base-level] + 3)
+.    an*bookmark \\n[an*bookmark-level] "\\*[an*subsection-heading]"
 .    nop \&\\$*
 .  \}
 .  if \\n[an-remap-I-style-in-headings] .ftr I I



reply via email to

[Prev in Thread] Current Thread [Next in Thread]