Link to other sites

Our documentation often relies on the reader knowing something about third-party standards or software. In such cases, it's better to link to good documentation elsewhere than to try to thoroughly document someone else's standard in our documentation.

On the other hand, sometimes a few sentences of basic information can save readers a trip to an external site. For example, our API documentation has traditionally included a brief explanation of REST. As knowledge of REST becomes more widespread, we might be able to assume that readers already know about it, and can remove those brief explanations.

Another example: If you want to mention one HTTP status code, then describing it in your document might make sense. If you want to make sure that your reader understands the idea of HTTP status codes, and knows what several of them mean, then linking them to an external document (such as the HTTP spec) might be a good idea.

In some cases, you might discuss third-party tools or products (a library for a particular language, say, or a relevant utility); in such cases, it's okay to link to a relevant site.

Make sure that any site that you link to is high quality, reliable, and respectable.

Link to the most relevant page on a site. Link to the most relevant heading on a page.

If the URL has a locale indicator, in general, remove it. Many sites will then redirect to a version of the site that matches the user's browser locale setting. However, note the following:

  • Test the links that you remove the locale information from. In some cases, the locale indicator is a necessary part of the URL, so you might need to restore it.
  • If the link is to Wikipedia (for example, https://en.wikipedia.org/wiki/Operating-system-level_virtualization), then leave the locale indicator (en. in the example). Many Wikipedia articles don't exist in other languages, and even if they do, they aren't necessarily translations. Keeping the locale indicator guarantees that the link will work and that it goes to the article you intend.

Don't force links to open in a new tab or window. Let the reader decide how to open links.

In the rare situation that a link needs to open in a new tab or window, let the reader know that the link opens differently than expected.

Recommended:

<a href="/style/accessibility" target="_blank">Accessible content (opens in a new tab)</a>

Not recommended:

<a href="/style/accessibility" target="_blank">Accessible content</a>

Use an external link icon to indicate that the link goes to a different domain or server. For more information, see Links to pages on a different server.