Which is the preferred way to format references in question and answer texts?
I have now seen 3 variations:

[visible text](url)
[visible text][n]
     with n being a number and then at the bottom the actual reference:
     [n]: URL
[visible text][linkref]
    with linkref being a text to the actual reference:
    [linkref]: URL
    (Visually but not technically different from the second format)

Thoughts:

  • I usually use the first format when editing because it lets me edit the raw text in place.
    And anyone editing this always has the text and URL in view together.
  • The second format is the more traditional 'reference' that we all know from footnotes/endnotes
  • I came across the 3rd format in a suggested edit review and this interrupted my thought process: Wait, what's this - O, it's a link reference. I find this format unclear because the link text and link URL have no visual distinction other than their relative position.

Notes:

  • This is not a duplicate of What is the preferred link format in questions and answers?, because that is about the link text, not the link reference.
  • This does not apply to same site links where you can just past in a URL and the system resolves it to the question title - as demonstrated in the first note ;-)
  • I was unaware of that third option. – fredsbend Nov 30 at 18:39

While all formats are acceptable, I find the format [visible text][linkref] preferable.

Not having the URL in the text greatly increases readability while editing. It also allows for linking to the same URL twice, and it puts all URLs on the bottom, which makes checking and correcting easier (http -> https, for instance, or a new URL pattern for an often used source.

A well-chosen linkref should make it clear what is linked to, which makes it better than just a number.

My two cents (not meant to be a definitive answer):

I think all three are acceptable and have their own merits. The first style is reminiscent of how you declare an anchor in HTML (<a href="URL">visible text</a>) and favoured by programmers; the second looks more like an academic/literature reference to me. The second form is actually 'just' a special case of the third form, using numbers as identifiers. However, names are often more descriptive than just numbers. It's just not used that often (because people don't know about it, and the hyperlink button in the editor produces numbered links as well).

Note that you can put the link references like [1]: anywhere in the text, as long as they're a separate paragraph. If you do it directly below the paragraph where the link appears, the text and the URL are still in view together.

The second (and third) form have the advantage that you can link to the same page twice, without typing the URL twice. (The image uploader uses this as well; by default, it inserts a clickable image like [![image][1]][1].)


Actually, there is a fourth form: just using [linkref] in the text and [linkref]: URL at the bottom. For a demonstration, see below.

Wikipedia

You must log in to answer this question.

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