Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

link to perl documentation

by BillKSmith (Prior)
on Jun 15, 2019 at 15:08 UTC ( #11101402=monkdiscuss: print w/replies, xml ) Need Help??

In a recent post, I wanted to reference the perl documentation for the open function. The following code links to the right page, but does not go the section on 'open'.

[doc://perlfunc#open]

open

Am I overlooking some detail in the FAQ. (I am not even going to try to create a link to this today)

I believe that this example is typical of several links that I have posted. The same solution will probably apply to all of them, but lets concentrate on this one for now.

Bill

Replies are listed 'Best First'.
Re: link to perl documentation
by LanX (Archbishop) on Jun 15, 2019 at 15:17 UTC
    The monastery maintains a list of known functions and vars and is redirecting them

    like [doc://open] open

    Regarding "deep links", I remember this to be an annoying issue and perldoc.perl.org changing the format doesn't make it easier.

    That's why I wrote Wikisyntax for the Monastery, so that I can simply add the URL and it will be auto transformed into valid PM markup.

    Example:

    • pasting   http://perldoc.perl.org/perlsyn.html#Loop-Control
    • transforms to [HTTP://perldoc.perl.org/perlsyn.html#Loop-Control|perlsyn#Loop-Control]
    • shows perlsyn#Loop-Control

    Furthermore, if you look at the HTML sources of the perldocs you'll discover far more anchors and IDs than listed in the TOC.

    One could write a bookmarklet to make them visible as TOC and embedded anchor symbols to easily copy the URL then.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      The "known function" auto-handling is a bit unfortunate here, as "open" is already a documentation page: https://perldoc.pl/open (the post is failing if I linkify this)

      Because of the search "auto-redirect" going to one or the other, the "did you mean?" snippet at the top of the page was added for pages with the same name (notably also if, socket, fcntl).

        the post is failing if I linkify this

        Hmm.

        https://perldoc.pl/open

        Worked for me... ?

        I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.
        It is indeed unfortunate, but there is still the alternative to either my personal preference would be to allow any URI being pasted directly and being auto-transformed into internal markup.

        I suppose you are one of the maintainers of perldoc.pl, please consider signing in into perlmonks or at least signing the posts to facilitate longer discussions.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Re: link to perl documentation (updated)
by LanX (Archbishop) on Jun 15, 2019 at 15:29 UTC
    To answer the "root" question.

    Looks like the redesign of perldoc.perl.org changed the anchors considerably: *

    <dt>30</dt><dd><a id="open-FILEHANDLE%2cEXPR"></a><strong>open FILEHAN +DLE,EXPR </strong> </dd> <dt>30</dt><dd><a id="open-FILEHANDLE%2cMODE%2cEXPR"></a><strong>open +FILEHANDLE,MODE,EXPR</strong> </dd> <dt>30</dt><dd><a id="open-FILEHANDLE%2cMODE%2cEXPR%2cLIST"></a><stron +g>open FILEHANDLE,MODE,EXPR,LIST</strong> </dd> <dt>30</dt><dd><a id="open-FILEHANDLE%2cMODE%2cREFERENCE"></a><strong> +open FILEHANDLE,MODE,REFERENCE</strong> </dd> <dt>30</dt><dd><a id="open-FILEHANDLE"></a><strong>open FILEHANDLE</st +rong>

    so you'll need  [doc://perlfunc#open-FILEHANDLE] -> open FILEHANDLE now.

    not sure how older links in the monastery are effected.*

    anyway use [doc://open], this always works.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

    Update

    *) couldn't find any evidence for this, older posts with such links seem to work flawlessly

    see https://perlmonks.org/?node_id=3989;BIT=%5Bdoc%3A%2F%2Fperlfunc%23

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2019-09-23 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (278 votes). Check out past polls.

    Notices?