Template:Amazon book link/doc

This template generates links to Amazon web pages for books, based on the book's ISBN. Amazon ASIN product codes for books are ISBN-10.

It is designed to work with the  produced by Special:BookSources. That page removes punctuation from the supplied ISBN before generating, so this template does not need to handle punctuated or other formatted ISBN numbers.

The ISBN may be either ISBN-13 or ISBN-10. ISBN-13 numbers are converted to ISBN-10 where possible. For ISBN-10 and convertible ISBN-13 numbers, the template generates a link that navigates directly to the specific Amazon web page for the book.

ISBN-13 replaced ISBN-10 in 2007. ISBN-13 numbers that start with "979" have no equivalent ISBN-10. For ISBN-13 numbers that cannot be converted, or where the ISBN is invalid or unrecognised, the template generates a link that contains an Amazon search URL. If no ISBN is given, the template links to the relevant Amazon site's home page.

Except for Amazon home page links, all Amazon URLs generated by this template carry the Bogleheads Amazon affiliate tag.

Usage
Invoke with:

Parameters:
 * country: The two-character country code for the Amazon site, lowercase characters only. Optional. Default is us.
 * isbn: The ISBN for the book. Recommended. Should be a valid 10 character or 13 character ISBN. ISBN-13 numbers that start with "979" cannot be converted to Amazon ASINs. If not supplied, links to the relevant Amazon site home page.
 * name: The link name to display. Optional. Default is Amazon, where is the value of country converted to uppercase.

Parameters may also be supplied by position, in the order shown above.

Examples

 * Using results in:
 * Using results in:
 * Using results in:
 * Using results in:
 * Using results in: