Open solsticedhiver opened 12 years ago
I looked into this a bit. Turns out lots of manpages have extra blank lines in them but we usually don't see them because the default pager for man
will squeeze multiple blank lines into one. To prove this, you could try doing something like:
man -d curl
The last line of output (at least on my machine) is the command that man executes to view the curl man page. For me it's this:
(cd '/usr/share/man' && (echo ".ll 7.8i"; echo ".nr LL 7.8i"; /usr/bin/gunzip -c '/usr/share/man/man1/curl.1.gz') | /usr/bin/tbl | /usr/bin/groff -Wall -mtty-char -Tascii -mandoc -c | (/usr/bin/less -is || true))
If you run that command then you get the same output as man curl
. If you modify it so that the -is
is missing off of less (-i is for case-insensitive matching and -s is for squeezing blank lines) then you will probably see extra whitespace at the head of the man page. I do.
So I opened pull request #66 to fix this issue. As a workaround, set the PAGER environment variable:
PAGER="less -is" ronn -m ...
Note that since man
normally squeezes blank lines already, installing and viewing a manpage generated by ronn should not be affected by this issue.
I think the correct way to format code blocks would be something like this:
.P
.RS
.nf
\f(CW<line 1>\fP
...
\f(CW<line n>\fP
.fi
.RE
where <line 1>, ...,
I think tinkerbot's analysis is correct: the extra lines are added by nroff
at its rendering stage, downstream from the .roff
output. The single-"." lines are empty lines, and are ignored; they're just used for adding space to make your ROFF document readable. They're not causing this.
So the fix needs to be handled at the pager level, by modifying the default pager command. (And, as a user, making sure you don't have your $PAGER
or $MANPAGER
set to something that lacks the -s
.)
Looks like Ronn development is defunct. But I've made a Ronn-NG fork and addressed this issue over there, if you're still interested.
when using ronn to get a man page, ronn produce a man page with at least 2 or 3 blank lines around code block
No more than one blank lines is necessary
It seems ronn insert in the man page redondant information like .IP "" 0 followed by a .P which is basically the same. and other blank line with .