Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

NEW [doc://perldoc#deeplink] works now with all perldocs

by LanX (Cardinal)
on Feb 17, 2020 at 21:37 UTC ( #11113076=monkdiscuss: print w/replies, xml ) Need Help??

When I wrote Re: Bookmarklet to show deeplinks in perldoc.perl.org I noticed a bug in perlmonks.

Using Perl documentation with deeplinks (ie with #goto_anchor in URI) only worked with normal perldocs.

But with others like perlfunc they were not rendered correctly.

With today's patch this is fixed.

Try split /PATTERN/

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on NEW [doc://perldoc#deeplink] works now with all perldocs

Replies are listed 'Best First'.
Re: NEW [doc://perldoc#deeplink] works now with all perldocs
by Anonymous Monk on Feb 18, 2020 at 00:13 UTC
      I've submitted a new patch which should hopefully allow these alternative notations to work properly (after approval)

      • core module:
        [doc://B::Deparse] --> B::Deparse
      • core module.pm: (same)
        [doc://B::Deparse.pm] --> B::Deparse.pm
      • core module deeplink
        [doc://B::Deparse#Synopsis] --> Synopsis

      ... and for completenes

      • perlvar:
        [doc://$_] --> $_

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

      updates
      • expanded and commented tests
      • #IMPLEMENTATION-DETAILS was case sensitive
      • added perlvar

        G'day Rolf,

        I don't know if you've made several typos or if there's a problem with your patch. Obviously, as you're awaiting approval for the patch, I can't test it.

        You posted four links; these three are invalid:

        http://perldoc.perl.org/open.pm.html http://perldoc.perl.org/open.pm.html#Implementation-Details http://perldoc.perl.org/B/Deparse.pm.html

        In each case, if you remove the '.pm' part, they will be valid.

        I think it would also be a good test to show the open function ([doc://open]) resolving to https://perldoc.perl.org/functions/open.html and the open pragma ([doc://open.pm]) resolving to https://perldoc.perl.org/open.html.

        Update (additional information): More for completeness than anything else, I'll just add the http: is converted to https: by perldoc.perl.org regardless of whether the link is valid or not.

        — Ken

        [doc://open.pm#Implementation-Details] --> Implementation Details
        FAILs... because apparently anchor names are case sensitive, and the anchor names in use (mostly?) on perldoc.perl.org are AlL-cApS. Try:

        [doc://open.pm#IMPLEMENTATION-DETAILS] --> Implementation Details

        Should we convert the user-supplied anchor name to uppercase for this purpose? I tend to think so... but only if we believe that that will work 99.9% of the time for perldoc.perl.org.

        I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.
        I've submitted a new patch...

        Applied.

      > Implementation Details

      Pragmas having the same name like functions are a problem for doc, and there is no possible DWIM solution to decide which one is meant:

      • https://perldoc.perl.org/functions/open.html
      • https://perldoc.perl.org/open.html

      Your attempt to write open.pm to indicate a module/pragma might be a workaround.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

      PS: FWIW personally I'm using my own JS solution, which takes the full URL but shortens the text.

      • so this https://perldoc.perl.org/open.html#Implementation-Details
      • becomes [HTTPs://perldoc.perl.org/open.html#Implementation-Details|open#Implementation-Details]
      • displays open#Implementation-Details

        Indeed, adding .pm to indicate the pragma DWYM. :-)

        I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://11113076]
Approved by footpad
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2020-08-06 07:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (39 votes). Check out past polls.

    Notices?