Template:Election box US auto/doc

Basic
Example:

Primary
You can also include primary information in the same box. Example:

Autolinking
The template automatically tries to create links to candidates if they have pages. If the candidate's exact name has an article, then it will further check if it is a redirect, and follow it if so. Some candidates have redirects to the articles about their election, so we won't follow redirects to articles with the word "elections" in them. If no article exists (or it was a redirect to the election page), then no link is created unless  was passed.

Sometimes you want to manually control the link target, like in cases where there's a disambiguation page. You can do so by passing a parameter in the format of. For example, if the name in the dataset is, you would use.

{	"params": { "1": {			"label": "State", "example": "California", "type": "string", "required": true },		"2": {			"label": "Year", "description": "Year the election took place. Can also be a comma separated list of years for multiple boxes", "example": "2016", "type": "number", "required": true },		"3": {			"label": "Contest", "description": "Name of the contest as specified in the tabular data", "example": "United States Representative District 8", "type": "string", "required": true },		"type": { "label": "Type", "description": "Type of election, can be \"Primary\"", "type": "string", "default": "\"General\"" },		"hold": { "label": "Hold", "description": "\"held\" if the same party held the seat, or \"flip\" if Democrats/Republicans switched.", "example": "held" },		"gain": { "label": "Gain party", "description": "Name of party which gains the seat", "example": "Democratic", "type": "string" },		"loser": { "label": "Loser party", "description": "Name of party that lost the seat", "example": "Democratic", "type": "string" },		"primary": { "label": "Primary", "description": "Whether to include primary information in the same template", "example": "yes", "type": "string", "default": "no" },		"no headings": { "label": "no headings", "description": "Whether to disable automatic headings when multiple boxes are being generated (comma separated list of years)", "example": "yes", "type": "string", "default": "no" }	},	"description": "A template for US elections that automatically builds the table using tabular data from Commons.", "format": "inline" }