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

2010-07-14 Thread Daniel Leidert
Am Mittwoch, den 14.07.2010, 15:48 +0200 schrieb Manuel A. Fernandez
Montecelo:
> On Wednesday 14 July 2010 06:50:57 Charles Plessy wrote:
[..]
> > 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’ ?
[..]
> I don't know if this would help you, but the canonical (lintian) way to 
> check that everything is OK is like this:
> 
> LANG=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l  >/dev/null
> 
> 
> You might want to pipe it through |less or something to check for visual 
> artifacts.

You'll of course see the warnings via `... >  /dev/null'. But I fully
agree to Manual. This is the usual way to check the manual page (at
least I always use this):

LANG=C MANWIDTH=80 man --warning -l 

Regards, Daniel


--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1279138057.5311.89.ca...@haktar.wgdd.de



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

2010-07-14 Thread Manuel A. Fernandez Montecelo
Hi Charles,

On Wednesday 14 July 2010 06:50:57 Charles Plessy wrote:
> Dear all,
> 
> 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 _ 1QNAME Query (pair) NAME 2FLAG
> bitwise FLAG 3RNAME Reference sequence NAME 4POS 
> 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’ ?
> 
> Have a nice day,

I don't know if this would help you, but the canonical (lintian) way to 
check that everything is OK is like this:

LANG=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l  >/dev/null


You might want to pipe it through |less or something to check for visual 
artifacts.

from:
http://lintian.debian.org/tags/manpage-has-errors-from-man.html


Cheers.
-- 
Manuel A. Fernandez Montecelo 


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

2010-07-14 Thread Michael Tokarev
14.07.2010 13:14, Roger Leigh wrote:
> On Wed, Jul 14, 2010 at 08:57:12AM +0200, Luca Falavigna wrote:
>> Il 14/07/2010 6.50, Charles Plessy ha scritto:
>>> Does anybody know how a more convenient to display a
>>> manpage the same way as users will get it by using ‘man’ ?
>>
>> groff -T ascii -man 
>> zcat /usr/share/man/manX/XXX | groff -T ascii -m man
> 
> You want '-T utf8' to match the output in the original question.
> And you also need to run it through the preprocessors.
> 'cat manpage.1 | tbl | eqn | pic | groff -T utf8 -man > manpage.txt'
> or use groffer(1) to automatically run the needed preprocessors.

 $ man ./manpage.1 > manpage.txt

/mjt


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4c3db080.4060...@msgid.tls.msk.ru



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

2010-07-14 Thread Roger Leigh
On Wed, Jul 14, 2010 at 08:57:12AM +0200, Luca Falavigna wrote:
> Il 14/07/2010 6.50, Charles Plessy ha scritto:
> > Does anybody know how a more convenient to display a
> > manpage the same way as users will get it by using ‘man’ ?
> 
> groff -T ascii -man 
> zcat /usr/share/man/manX/XXX | groff -T ascii -m man

You want '-T utf8' to match the output in the original question.
And you also need to run it through the preprocessors.
'cat manpage.1 | tbl | eqn | pic | groff -T utf8 -man > manpage.txt'
or use groffer(1) to automatically run the needed preprocessors.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.


signature.asc
Description: Digital signature


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

2010-07-14 Thread Michael Tokarev
14.07.2010 09:01, Russ Allbery wrote:
[]
> 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.

This is the most close of all suggestions.  But even closer is:

 $ man ./manpage.1.gz

(or ./manpage.1, whatever).  It will run zcat automatically just like
it does for regular manpages.

 :)

/mjt


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4c3d72da.7030...@msgid.tls.msk.ru



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

2010-07-13 Thread Luca Falavigna
Il 14/07/2010 6.50, Charles Plessy ha scritto:
> Does anybody know how a more convenient to display a
> manpage the same way as users will get it by using ‘man’ ?

groff -T ascii -man 
zcat /usr/share/man/manX/XXX | groff -T ascii -m man

-- 

  .''`.
 : :' :   Luca Falavigna 
 `. `'
   `-



signature.asc
Description: OpenPGP digital signature


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

2010-07-13 Thread Russ Allbery
Charles Plessy  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 _
>1QNAME Query (pair) NAME 2FLAG bitwise FLAG
>3RNAME Reference sequence NAME 4POS  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 (r...@debian.org)