Rupert Swarbrick | 12 Dec 03:03 2010
Picon

Man page encodings

Hi there,

I've been trying to un-reinvent at least one wheel in yelp's man page
handling and was wondering if someone could have a look at the
result. My idea was that at the moment (mainly because the language
guessing is wrong?), re-encoding man pages is broken.

For example, on debian with yelp from git, type something like

  LC_ALL=de_DE yelp man:man

and look at the umlauts.

Then I noticed that

  man -R utf-8 man

worked fine.

"Ahah!" I said. "Let's just use man -R". Of course, this isn't any good
because not all computers that can run yelp have man-db installed :-( So
here's a patch that works out whether it is installed and, if so, uses
it instead.

Comments please!

Rupert

(Continue reading)

Rupert Swarbrick | 12 Dec 13:23 2010
Picon

Man page locations


Hot off the press! After playing with the encoding support (which was
actually broken), I thought I'd have a look at the logic for *finding*
man pages.

I noticed the obsolete (and ancient!) bug 95497 and realised that if man
is installed, it should know how to find its pages!

So I cooked up this patch, ripping out our attempts at finding the file
manually and replacing them with code to get man to do it for us. The
result is only ~20 lines shorter, but has lots of comments (and no
gotos!). Also, it allows relative file paths, which the previous version
didn't.

Anyway, here's the patch.

Rupert

_______________________________________________
gnome-doc-devel-list mailing list
gnome-doc-devel-list@...
http://mail.gnome.org/mailman/listinfo/gnome-doc-devel-list
Rupert Swarbrick | 12 Dec 23:09 2010
Picon

Re: Man page locations


Gah. It seems that I don't understand 'git commit --amend'. This version
correctly deals with fragments of pages, I think.

Rupert

_______________________________________________
gnome-doc-devel-list mailing list
gnome-doc-devel-list@...
http://mail.gnome.org/mailman/listinfo/gnome-doc-devel-list
Rupert Swarbrick | 14 Dec 17:17 2010
Picon

Re: Man page encodings

Ignore this patch/suggestion. The post I've just made with groff output
parsing is a much better approach I think.

Rupert
_______________________________________________
gnome-doc-devel-list mailing list
gnome-doc-devel-list@...
http://mail.gnome.org/mailman/listinfo/gnome-doc-devel-list
Rupert Swarbrick | 14 Dec 17:25 2010
Picon

Re: Man page encodings

Rupert Swarbrick <rswarbrick@...>
writes:
> Ignore this patch/suggestion. The post I've just made with groff output
> parsing is a much better approach I think.
>
> Rupert

Er, or it will be when it gets past the moderator queue :-)
_______________________________________________
gnome-doc-devel-list mailing list
gnome-doc-devel-list@...
http://mail.gnome.org/mailman/listinfo/gnome-doc-devel-list
Rupert Swarbrick | 14 Dec 17:16 2010
Picon

Parsing groff output for manpages instead.

Hi,

I've spent a few hours staring at the bug
https://bugzilla.gnome.org/show_bug.cgi?id=477788 and thought I could
hack together something based on the groff intermediate format.

And I've attached the resulting patch. Also, I've attached the new
version of yelp-man-parser.c, since the changes are massive enough to
make the diff pretty unhelpful.

I'd love to hear feedback. It's not ready for merging yet, since there's
a complete hack for named character lines (the hack works for English
and German, but not for Czech etc.).

But already, it looks better than yelp master on man:man and man:perl
etc.

Have a play and let me know what you think!

Rupert

P.S. Oh, and one more reason:

rupert <at> hake:/git/yelp git diff --stat master
 libyelp/yelp-man-document.c |    6 +-
 libyelp/yelp-man-parser.c   | 2322 +++++++++++++------------------------------
 libyelp/yelp-man-parser.h   |    4 +-
 stylesheets/man2html.xsl.in |  366 +------
 4 files changed, 766 insertions(+), 1932 deletions(-)

(Continue reading)

Rupert Swarbrick | 15 Dec 00:59 2010
Picon

Re: Parsing groff output for manpages instead.

Rupert Swarbrick <rswarbrick@...>
writes:
> Hi,
>
> I've spent a few hours staring at the bug
> https://bugzilla.gnome.org/show_bug.cgi?id=477788 and thought I could
> hack together something based on the groff intermediate format.
>
> And I've attached the resulting patch. Also, I've attached the new
> version of yelp-man-parser.c, since the changes are massive enough to
> make the diff pretty unhelpful.
>

Just for laughs, I had a look at the list of bugs in the 'Man pages'
section for Yelp.

I *think* this patch fixes the following (report years in brackets)

347094 (2006)
349677 (2007)
497559 (2007)
513247 (2008)
554138 (2008)
566519 (2009)
575457 (2009)
588164 (2009)
602334 (2009)
636276 (2010)

It may well fix 71027 (from 2002) and 505644 (from 2007) as well, but I
(Continue reading)

Shaun McCance | 15 Dec 03:11 2010
Picon

Re: Parsing groff output for manpages instead.

On Tue, 2010-12-14 at 23:59 +0000, Rupert Swarbrick wrote:
> Rupert Swarbrick <rswarbrick@...>
> writes:
> > Hi,
> >
> > I've spent a few hours staring at the bug
> > https://bugzilla.gnome.org/show_bug.cgi?id=477788 and thought I could
> > hack together something based on the groff intermediate format.
> >
> > And I've attached the resulting patch. Also, I've attached the new
> > version of yelp-man-parser.c, since the changes are massive enough to
> > make the diff pretty unhelpful.
> >
> 
> Just for laughs, I had a look at the list of bugs in the 'Man pages'
> section for Yelp.
> 
> I *think* this patch fixes the following (report years in brackets)
> 
> 347094 (2006)
> 349677 (2007)
> 497559 (2007)
> 513247 (2008)
> 554138 (2008)
> 566519 (2009)
> 575457 (2009)
> 588164 (2009)
> 602334 (2009)
> 636276 (2010)

(Continue reading)

Rupert Swarbrick | 15 Dec 10:40 2010
Picon

Re: Parsing groff output for manpages instead.

Shaun McCance <shaunm@...> writes:
> Sorry I've been slow responding. There's a lot to digest in all
> these patches. I'll look at them more closely within the week.

Don't worry - I just wanted to check they wouldn't get lost: there are a
few sort of band-aid patches on the bugzilla which seem to have slipped
through the cracks...

Rupert
_______________________________________________
gnome-doc-devel-list mailing list
gnome-doc-devel-list@...
http://mail.gnome.org/mailman/listinfo/gnome-doc-devel-list
Rupert Swarbrick | 15 Dec 02:50 2010
Picon

Re: Parsing groff output for manpages instead.

Rupert Swarbrick <rswarbrick@...>
writes:
> Hi,
>
> I've spent a few hours staring at the bug
> https://bugzilla.gnome.org/show_bug.cgi?id=477788 and thought I could
> hack together something based on the groff intermediate format.
>
> And I've attached the resulting patch. Also, I've attached the new
> version of yelp-man-parser.c, since the changes are massive enough to
> make the diff pretty unhelpful.
>

Haha! It's better now. I'm attaching a new-and-improved version that can
correctly format (I think) the Russian version of man:man too. It
doesn't completely die on the Japanese version, but I have no idea
what that's *supposed* to look like, so it's a bit of a mystery to
me!

Anyway, I reckon this is definitely better than the current git master
now: maybe I should be trying to convince someone to merge it? If you
want a (messy!) git history for the changes, I can send it, but I
suspect you don't...

Rupert

Attachment (groff_patch.patch): text/x-diff, 100 KiB
_______________________________________________
(Continue reading)


Gmane