perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

[doc] Fix HTTP and Books links

Open rwp0 opened this issue 9 months ago • 3 comments

Update some obsolete Perl book URL's

Convert some HTTP links to HTTPS

rwp0 avatar Apr 29 '24 21:04 rwp0

Fixed some more Oreilly book URL's converting from catalog (which doesn't function anymore) to a shorter version of library/view.

rwp0 avatar Apr 30 '24 14:04 rwp0

That's the only one remaining (untouched by the PR):

  • https://github.com/Perl/perl5/blob/01da7deeb3040e817139193b4f8e4390ceb56f43/pod/perlbook.pod?plain=1#L97

Because the replacement for it is (looks like moved from Oreilly proper):

  • https://shopthemarketplace.com/get-it-now/product/perl-pocket-reference-5th-edition-by-johan-vromans-paperback-target-a4a4a9

whose URL is too long (crossing the 78 character limit) for POD checking tests.

rwp0 avatar Apr 30 '24 14:04 rwp0

Since about minor doc changes, can this be merged before the 5.40 release?

rwp0 avatar May 02 '24 21:05 rwp0

@jkeenan can you please review this again? I corrected all book references to their new and working URL's.

rwp0 avatar May 11 '24 15:05 rwp0

@jkeenan I wrapped all URL's in L<>. Please approve if all good now.

rwp0 avatar May 12 '24 17:05 rwp0

Unfortunately, those newly added L<> links didn't have the effect I was hoping for. Many of them are already in indented blocks, which means that perldoc treats them as code (C<>) and presents them like this:

    *Programming Perl* (the "Camel Book"):
         by Tom Christiansen, brian d foy, Larry Wall with Jon Orwant
         ISBN 978-0-596-00492-7 [4th edition February 2012]
         ISBN 978-1-4493-9890-3 [ebook]
         L<https://www.oreilly.com/library/view/-/9781449321451/>

So there are about 30 instances of L<> in indented blocks which need to be removed. This regex should clean up most of them:

$ perl -pi -e 's/^(\s+)L<(.*)>/$1$2/' pod/perlbook.pod

There will be one in the entry for Higher-Order Perl that you'll have to manually clean up. When you're done, you can get a rough idea of how this will look in HTML by calling:

$ pod2html --infile=pod/perlbook.pod --outfile=/tmp/perlbook.html --no-index

I'm sorry that my suggestion didn't work out.

jkeenan avatar May 15 '24 11:05 jkeenan

Unfortunately, those newly added L<> links didn't have the effect I was hoping for. Many of them are already in indented blocks, which means that perldoc treats them as code (C<>) and presents them like this:

    *Programming Perl* (the "Camel Book"):
         by Tom Christiansen, brian d foy, Larry Wall with Jon Orwant
         ISBN 978-0-596-00492-7 [4th edition February 2012]
         ISBN 978-1-4493-9890-3 [ebook]
         L<https://www.oreilly.com/library/view/-/9781449321451/>

So there are about 30 instances of L<> in indented blocks which need to be removed. This regex should clean up most of them:

$ perl -pi -e 's/^(\s+)L<(.*)>/$1$2/' pod/perlbook.pod

There will be one in the entry for Higher-Order Perl that you'll have to manually clean up. When you're done, you can get a rough idea of how this will look in HTML by calling:

$ pod2html --infile=pod/perlbook.pod --outfile=/tmp/perlbook.html --no-index

I'm sorry that my suggestion didn't work out.

Thanks, I will.

At least we realize now why those URL's weren't "linkified" originally 🙂

rwp0 avatar May 15 '24 18:05 rwp0

@jkeenan I removed all L<>'s from book references. Hope everything is okay now and we can merge this PR already 🙂

rwp0 avatar May 15 '24 20:05 rwp0

@rwp0, pod/perllocale.pod had evolved since you worked on it, so there were merge conflicts. I fetched your pull request, rebased on blead, resolved merge conflicts, merged the result into blead and pushed to origin in e3f226d5c6ed. Please check that I got all your changes correct. @khwilliamson, please check that I resolved merge conflicts in perllocale satisfactorily. Taking this ticket for the purpose of closing it once we know those conflicts were correctly resolved. Request that any further documentation issues be discussed in a new ticket/pull request. Thanks.

jkeenan avatar May 16 '24 00:05 jkeenan