groff-commit
[Top][All Lists]
Advanced

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

[groff] 38/51: [mdoc]: Stop prefixing center header with "BSD".


From: G. Branden Robinson
Subject: [groff] 38/51: [mdoc]: Stop prefixing center header with "BSD".
Date: Sun, 11 Sep 2022 08:15:55 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit f911d0075cdae4a9f940ef2cad27e53a7af01b61
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Sep 7 23:29:29 2022 -0500

    [mdoc]: Stop prefixing center header with "BSD".
    
    Stop prefixing center header with name of operating system.  This was
    hard-coded to "BSD" and stuck on all mdoc(7) pages using a default
    manual section number, regardless of host operating system.  Bad idea.
    Further, the argument to the `Os` call, if any, or a default, is always
    disclosed in the left footer, so the foregoing practice gave the reader
    no new information.  (On the other hand, header and footer rendering was
    not reliable in continuous rendering mode, the default for terminals, in
    groff 1.22.4 and earlier.  It is now.)
    
    * tmac/mdoc/doc-common: Do it.
    
      (Dt): Initialize `doc-volume` as empty and annotate it; calling the
      macro with a numeric second argument overrides the fallback default of
      "LOCAL".  A slash is no longer needed to separate a recognized
      architecture string from the OS name, so drop it.
    
    * tmac/groff_mdoc.7.man: Stop using the string in examples.  Also
      correct table format specification declaring 3 columns but using 2.
    
    * tmac/tests/doc_smoke-test.sh: Update test expectations.
---
 ChangeLog                    | 18 ++++++++++++++++++
 tmac/groff_mdoc.7.man        | 26 +++++++++++++-------------
 tmac/mdoc/doc-common         |  5 ++---
 tmac/tests/doc_smoke-test.sh |  2 +-
 4 files changed, 34 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a8b4aba76..43a0ac144 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2022-09-07  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [mdoc]: Stop prefixing center header with name of operating
+       system.  This was hard-coded to "BSD" and stuck on all mdoc(7)
+       pages using a default manual section number, regardless of host
+       operating system.  Bad idea.  Further, the argument to the `Os`
+       call, if any, or a default, is always disclosed in the left
+       footer.
+
+       * tmac/mdoc/doc-common: Do it.
+       (Dt): Initialize `doc-volume` as empty and annotate it;
+       calling the macro with a numeric second argument overrides the
+       fallback default of "LOCAL".  A slash is no longer needed to
+       separate a recognized architecture string from the OS name, so
+       drop it.
+
+       * tmac/tests/doc_smoke-test.sh: Update test expectations.
+
 2022-09-07  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [mdoc]: Drop dead code.  The register
diff --git a/tmac/groff_mdoc.7.man b/tmac/groff_mdoc.7.man
index 10152aef9..ac8ae17f8 100644
--- a/tmac/groff_mdoc.7.man
+++ b/tmac/groff_mdoc.7.man
@@ -839,16 +839,16 @@ the following sections are defined:
 .
 .Pp
 .TS
-l l l.
-1      \*[doc-volume-operating-system] \*[doc-volume-ds-1]
-2      \*[doc-volume-operating-system] \*[doc-volume-ds-2]
-3      \*[doc-volume-operating-system] \*[doc-volume-ds-3]
-4      \*[doc-volume-operating-system] \*[doc-volume-ds-4]
-5      \*[doc-volume-operating-system] \*[doc-volume-ds-5]
-6      \*[doc-volume-operating-system] \*[doc-volume-ds-6]
-7      \*[doc-volume-operating-system] \*[doc-volume-ds-7]
-8      \*[doc-volume-operating-system] \*[doc-volume-ds-8]
-9      \*[doc-volume-operating-system] \*[doc-volume-ds-9]
+l l.
+1      \*[doc-volume-ds-1]
+2      \*[doc-volume-ds-2]
+3      \*[doc-volume-ds-3]
+4      \*[doc-volume-ds-4]
+5      \*[doc-volume-ds-5]
+6      \*[doc-volume-ds-6]
+7      \*[doc-volume-ds-7]
+8      \*[doc-volume-ds-8]
+9      \*[doc-volume-ds-9]
 .TE
 .
 .
@@ -925,16 +925,16 @@ prevents the digit\~7 from being a valid numeric 
expression.
 .Bl -tag -width ".Li .Dt\ FOO\ 2\ i386" -compact -offset indent
 .It Li ".Dt FOO 7"
 .Ql FOO(7)
-.Ql \*[doc-volume-operating-system] \*[doc-volume-ds-7]
+.Ql \*[doc-volume-ds-7]
 .It Li ".Dt FOO 7 bar"
 .Ql FOO(7)
-.Ql \*[doc-volume-operating-system] \*[doc-volume-ds-7]
+.Ql \*[doc-volume-ds-7]
 .It Li ".Dt FOO \e&7 bar"
 .Ql FOO(7)
 .Ql bar
 .It Li ".Dt FOO 2 i386"
 .Ql FOO(2)
-.Ql \*[doc-volume-operating-system]/\*[doc-volume-as-i386] \*[doc-volume-ds-2]
+.Ql \*[doc-volume-ds-2]
 .It Li ".Dt FOO \[dq]\[dq] bar"
 .Ql FOO
 .Ql bar
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index 3845a507e..dd936a808 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -348,7 +348,6 @@
 .
 .\" an alternative, more detailed scheme for naming the manual sections
 .\"
-.ds doc-volume-operating-system BSD
 .ds doc-volume-ds-1 General Commands Manual
 .ds doc-volume-ds-2 System Calls Manual
 .ds doc-volume-ds-3 Library Functions Manual
@@ -472,10 +471,10 @@
 .    ds doc-section \$2
 .    ie \B'\$2' \{\
 .      if ((\$2 >= 1) & (\$2 <= 9)) \{\
-.        ds doc-volume "\*[doc-volume-operating-system]
+.        ds doc-volume \" empty (not "LOCAL")
 .        if \A'\$3' \{\
 .          if d doc-volume-as-\$3 \
-.            as doc-volume "/\*[doc-volume-as-\$3]
+.            as doc-volume "\*[doc-volume-as-\$3]
 .          \}
 .        as doc-volume " \*[doc-volume-ds-\$2]
 .      \}
diff --git a/tmac/tests/doc_smoke-test.sh b/tmac/tests/doc_smoke-test.sh
index a3d343253..cb4cd4ef7 100755
--- a/tmac/tests/doc_smoke-test.sh
+++ b/tmac/tests/doc_smoke-test.sh
@@ -38,7 +38,7 @@ things are probably working.'
 OUTPUT=$(printf "%s\n" "$EXAMPLE" | "$groff" -Tascii -P-cbou -mdoc)
 FAIL=
 
-if ! echo "$OUTPUT" | grep -qE '^mdoc-test\(7\) +BSD Miscellaneous'
+if ! echo "$OUTPUT" | grep -qE '^mdoc-test\(7\) +Miscellaneous'
 then
     FAIL=yes
     echo "header check failed" >&2



reply via email to

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