Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: New bracket-link stuff

by davido (Archbishop)
on Apr 24, 2004 at 05:15 UTC ( #347820=note: print w/ replies, xml ) Need Help??


in reply to New bracket-link stuff

Bravo theorbtwo. From CB discussion to actual preliminary implementation in 24 hours!

One thought on the ability to configure [doc://...] for different POD versions...

You could allow for this type of format: [doc://podname:version]. I know of no POD containing a colon in its name. The trick would be that if the version number is for a version not available on www.perldoc.com, the DWIMery mechanism would go for the next higher or next lower version that does exist on the site. I would vote for "rounding down" to the nearest version. For example, if someone requests the following link: [doc://perlre:5.8.2], which doesn't exist at www.perldoc.com, the mechanism would round down to [doc://perlre:5.8.0].

Also, it may be nice to allow for a user setting that sets the "default" POD version number to be used with the [doc:// tag.

Some of this may be too much work; I don't know what the code looks like.

One other question: Is there a defined behavior if this tag is used on core modules?

Anyway, good job on getting this up and running so fast.


Dave


Comment on Re: New bracket-link stuff
Select or Download Code
Re: Re: New bracket-link stuff
by theorbtwo (Prior) on Apr 24, 2004 at 10:58 UTC

    I was thinking for specific-version links, allowing doc://5.8.3/perlre, and making a drop-down in user settings to set your default.

    There is a defined behavior for use on any string not matching /^perl/: assuming it is a function. Thus, Time::Local links to the documentation of the (nonexistant) function Time::Local; if you wanted the documentation of that module, you should have said Time::Local. (Core modules are on cpan.) I may change that to output some plain ol text, as it's pretty clearly an error. I may even extend the DWYMery to link to the POD for that module, though I'm worried that we'll get into places where we are unable to do what you meant: is doc://open documentation on the module open, or the function open? (Yes, there is one of each.)


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      Allow, detect, and strip trailing doublecolons. perl does this, so we should too. Then Open:: is distinct from open.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2014-09-21 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (165 votes), past polls