Re: Fix and improve reference links (was: GSoC status: classification, output format and more)
Just some small comments:
On Tue, Aug 12, 2008 at 01:05:19PM +0200, Jordà Polo wrote:
> On Tue, Aug 12, 2008 at 06:48:37AM +0200, Frank Lichtenheld wrote:
> > Do you maybe have an idea how we could enable the devref four part
> > section number links. Maybe it could fall back to the three part
> > section number?
>
> + qr/<h[4-5]+ class="title"><a id="(.+?)"><\/a>([\d\.]+?)\.? ([\w\s[:punct:]]+?)<\/h[4-5]+>/
h[45] should suffice, no need to search for h45 ;)
> + if ($ref{url} =~ m/^(.+?\.html)#?/i) {
> + push(@linked_pages, $1) if not grep(m/$1/, @linked_pages);
> + }
I think using a hash instead (i.e. $linked_pages{$1}++) is more compact,
but maybe that's just me.
> + # If the extracted URL part doesn't look like a URL, assume it is
> + # an "incomplete" ID.
> + if ($ref{url} and not $ref{url} =~ m/(?:#|\.html$)/i) {
> + $ref{url} = basename($page) . "#$ref{url}";
> + }
Can you give me an examples where this code gets used?
> + unless (-f $index) {
> + print STDERR "Manual '$manual' not installed; not updating.\n";
> + next;
> + }
Since the script doesn't use the old list anymore, wouldn't a "die" be more
appropriate here? AFAICT it will just loose all the refs to the skipped
manuals?
Gruesse,
--
Frank Lichtenheld <djpig@debian.org>
www: http://www.djpig.de/
Reply to: