It occured to me 10 seconds ago, that there wasn't any simple way to include hyperlinks inside of <code> blocks.

In particular I was trying to make a line that said "use LWP::Simple;" look like: "use LWP::Simple", but instead i got: "use [cpan://LWP::Simpl]"

Then it occured to me, that it would seriously ROCK! if code blocks automaticly hyperlinked all "use" lines to the corrisponding "cpan://" url, or if built in functions got hyperlinked to their "perldoc -f" descriptions ... maybe even operators could be linked to their descriptions from perlop.

Obviously, some code could get hard to read and cluttered if this happened automaticly ... but what if it was implimented as optional attributes for the <code> tag -- soo you could specify what exactly you wanted hyperlinked (to feature the particular pieces of code you think the reader should read up on)? Something like these maybe...

Not sure how feasible this all is ... i'm kind of reaching with that "urls" attribute idea, but i thought i'd throw it out there.


In reply to auto-hyperlinking code? by hossman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.