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

Re: How to test a manpage? ‘nroff -man | less’ does not display like ‘man’.



Charles Plessy <plessy@debian.org> writes:

> before updating a package, I wanted to look at the new upstream manpage,
> but realised that ‘nroff -man’ does not produce the same output as ‘man’
> itself.  Let's take the example of samtools(1) from the samtools
> package.

> With ‘man samtools’, users can see tables like the following one in the
> section ‘SAM FORMAT’.

> ┌────┬───────┬──────────────────────────────────────────────────────────┐
> │Col │ Field │                       Description                        │
> ├────┼───────┼──────────────────────────────────────────────────────────┤
> │ 1  │ QNAME │ Query (pair) NAME                                        │
> │ 2  │ FLAG  │ bitwise FLAG                                             │
> │ 3  │ RNAME │ Reference sequence NAME                                  │
> (…)

> But with ‘zcat /usr/share/man/man1/samtools.1.gz | nroff -man | less’,
> here is what I get.

>        center  box;  cb  |  cb  | cb n | l | l .  Col  Field     Description _
>        1    QNAME     Query     (pair)     NAME     2    FLAG bitwise     FLAG
>        3    RNAME     Reference sequence NAME 4    POS  1-based leftmost POSi‐

> The workaround I found was to copy the new manpage in /tmp/man/man1, and
> call ‘man -M /tmp/man samtools’. Does anybody know how a more convenient
> to display a manpage the same way as users will get it by using ‘man’ ?

This is specific to man pages that use one of the helpers, usually either
tbl or pic.  In this particular case, it's using tbl.

You can just run man directly on the *roff file, but if you want to stick
with the zcat pipeline, just add the -t flag to nroff to say to run the
output through the tbl preprocessor first.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>

Reply to: