What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

Suppose I have the following code:

List<Integer> list = new ArrayList<Integer>();

Is there a way to make ArrayList above point to its documentation?

share|improve this question
add comment

4 Answers

up vote 8 down vote accepted

int main() {
    yes_you_can();
    return 0;
}

It requires the use of explicit HTML, though.

share|improve this answer
3  
I guess the downside of using explicit HTML is that you don't get syntax highlighting. –  Darthenius Dec 6 '11 at 19:16
1  
Oof, that's ugly though. I knew about the HTML approach but didn't realize that characters on the following line would hide the link underlining. –  Pops Dec 6 '11 at 21:06
    
@PopularDemand: That's probably browser-dependent. It looks fine in Chrome. –  hammar Dec 7 '11 at 12:50
    
Oh, okay. FF5 Win7 here, for what it's worth. –  Pops Dec 7 '11 at 15:16
add comment
List<Integer> list = new [ArrayList]<Integer>();

Doesn't seem like you can (see edits to this answer)

But you can do:

List<Integer> list = new ArrayList<Integer>();

Which is a link (but the whole line)

share|improve this answer
1  
Your whole-line example renders identically to just plain old code for me. Seems like the potential for confusion is very high. –  sarnold Dec 6 '11 at 21:40
add comment

Answers containing code almost always contain such references in the descriptive text; you can put your links there (To illustrate, I modified your ArrayList reference to link it to the documentation).

share|improve this answer
add comment

Using the technique shown in hammar's answer, here's the original example using explicit HTML:

List<Integer> list = new ArrayList<Integer>();

share|improve this answer
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .