Thread (14 messages) 14 messages, 2 authors, 2024-04-14

Re: Linux man-pages PDF book

From: Alejandro Colomar <alx@kernel.org>
Date: 2024-04-14 12:42:55
Subsystem: the rest · Maintainer: Linus Torvalds

On Sun, Apr 14, 2024 at 02:32:25PM +0200, Alejandro Colomar wrote:
Hi Branden,

On Sun, Apr 14, 2024 at 06:57:43AM -0500, G. Branden Robinson wrote:
quoted
At 2024-04-14T13:37:15+0200, Alejandro Colomar wrote:
quoted
There's also the page issue.  Now it seems to reset the page number for
every TH.
This might be a simple issue.  Make sure that you're passing groff (or
troff) an option to set the `C` register to a true value.

groff_man(7):
     -rC1     Number output pages consecutively, in strictly increasing
              sequence, rather than resetting the page number to 1 (or
              the value of register P) with each new man document.
Hmmmm.  Maybe I should follow v7's tradition and restart the page number
at each TH.  Let's call it an accidental improvement, and not a
regression.  :)

Although it would be interesting to learn when/why this changed.
It seems to have been here:

$ git show 6d87a75a6df0 -- scripts/LinuxManBook/build.sh;
commit 6d87a75a6df0696e780255d865bf65da09f36f01
Author: Alejandro Colomar [off-list ref]
Date:   Fri Dec 1 00:55:11 2023 +0100

    scripts/LinuxManBook/: Simplify pipeline
    
    Call the groff(1) pipeline only once.  This optimizes around 2 seconds,
    while also simplifying the code.
    
    This change was originally written by Deri, with some parts written by
    Brian.  I took the script that Deri sent, and split it so that the
    groff(1) pipeline is called from the shell script, and the Perl script
    is limited to editing the man(7) pages.  This helps me understand the
    process, since my understanding of Perl is very limited.  It also makes
    this change smaller, so that it's less of a big-bang.
    
    Link: <https://lore.kernel.org/linux-man/ZWkO4qPC4BxkwBNm@debian/T/#m3d453440b02dd189bc12d2e629c4026206025b40 (local)>
    Co-developed-by: Deri James [off-list ref]
    Co-developed-by: Brian Inglis [off-list ref]
    Signed-off-by: Alejandro Colomar [off-list ref]
diff --git a/scripts/LinuxManBook/build.sh b/scripts/LinuxManBook/build.sh
index a6e578f64..8e373c073 100755
--- a/scripts/LinuxManBook/build.sh
+++ b/scripts/LinuxManBook/build.sh
@@ -3,25 +3,13 @@
 # SPDX-License-Identifier: GPL-3.0-or-later
 
 (
-       "$(dirname "$0")"/prepare.pl "$1" \
-       | preconv \
-       | pic \
-       | tbl \
-       | eqn -Tpdf \
-       | troff -Tpdf -dPDF.EXPORT=1 -dLABEL.REFS=1 -dpaper=a4 \
-               -M"$(dirname "$0")" -mandoc -manmark -rC1 -rCHECKSTYLE=3 \
-               2>&1 >/dev/null \
-       | LC_ALL=C grep '^\. *ds ';
-
+       cat "$(dirname "$0")"/LMBfront.roff;
+       cat "$(dirname "$0")"/an.tmac;
        "$(dirname "$0")"/prepare.pl "$1";
 ) \
 | preconv \
 | pic \
 | tbl \
 | eqn -Tpdf \
-| (
-       troff -Tpdf -ms <"$(dirname "$0")"/LMBfront.ms;
-       troff -Tpdf -M"$(dirname "$0")" -mandoc -manmark \
-               -F"$(dirname "$0")" -dpaper=a4;
-) \
+| troff -Tpdf -F"$(dirname "$0")" -dpaper=a4 \
 | gropdf -F"$(dirname "$0")" -pa4;
-- 
<https://www.alejandro-colomar.es/>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help