Template:Excerpt/doc

This template is used for transcluding part of an article into another article.

Basic usage

 * — Transclude the lead section of an article (see example).
 * — Transclude a specific section excluding any subsections (see example).

Problems with references

 * Sometimes the transcluded content may contain a reference with the same name as a reference in the transcluding article. This will produce a "duplicate reference name" error. To fix it, simply rename one of the references (it doesn't matter which).
 * Sometimes the transcluded content may contain a reference whose body is somewhere else in the transcluded article. This will produce an "unknown reference" error. To fix it, simply move the body of the reference to the transcluded content.

Parameters

 * or  — Title of the article to transclude. Only required parameter. If no other parameters are used, the lead section will be transcluded (see example).
 * or  — Title of the section to transclude (see example).
 * — Name of the fragment to transclude. Must be marked with  and   in the transcluded article (see example).
 * — Hide the hatnote "This section is an excerpt from..."
 * — Specify the paragraphs to transclude. For example  will transclude paragraphs 1, 2, 3 and 5. By default all paragraphs are transcluded. Notice that if the paragraph order changes in the source article, the transcluded paragraphs will change too and without any notice, so use with caution. Doesn't work with.
 * — Specify the files to transclude. For example  will transclude files 1, 2, 3 and 5. By default only the first file is transcluded. Doesn't work with.
 * — Determines whether to show a vertical bar along the excerpt to indicate where it starts and where it ends. By default none is shown. Set to  to cause it to show.
 * — Determines whether to transclude references or not. By default all references are transcluded. Set to  to prevent it.
 * — Determines whether to transclude tables or not. By default all tables are transcluded. Set to  to prevent it.
 * — Use together with  to transclude the entire section including any subsections. Notice that if the transclusion is done from a section level 3, and the transcluded subsections are level 3 too, then the transcluded subsections will show with the same hierarchy as the transcluding section, which is probably not desirable, so use with caution.
 * — By default the excerpt is wrapped with  tags. Set to   to wrap it with   tags instead.

Replacing Template:Main
Excerpts can often be used in place of Main, after merging the content of the section into the main article. Doing so usually improves the main article as well as the section.

An efficient way to proceed is:
 * 1) Open the article with Main in one tab, and the main article in another.
 * 2) Edit both.
 * 3) Copy the text of the section with Main and paste it below the introduction of the main article.
 * 4) Delete repeated content and adjust using common sense.
 * 5) Save the changes in the main article with an edit summary like: Bring content from Some article.
 * 6) Back to the section with Main, delete all content and replace it for an excerpt.
 * 7) Save the changes in the section with an edit summary like: Move content to Main article and leave excerpt.
 * 8) Check for any problems with references and fix as needed.

Template data
{	"params": { "1": {			"aliases": [ "article" ],			"label": "Article", "description": "Title of the article to transclude", "example": "Science", "type": "wiki-page-name", "required": true },		"2": {			"aliases": [ "section" ],			"label": "Section", "description": "Title of the section to transclude", "example": "History", "type": "string" },		"fragment": { "label": "Fragment", "description": "Name of the fragment to transclude", "example": "definition", "type": "string" },		"nohat": { "description": "Whether to remove the hatnote", "label": "No hatnote", "example": "yes", "type": "boolean" },		"paragraphs": { "label": "Paragraphs", "description": "What paragraphs to transclude", "example": "1-3,5", "type": "string" },		"files": { "label": "Files", "description": "What files to transclude", "example": "1-3,5", "type": "string", "default": "1" },		"subsections": { "label": "Subsections", "description": "Whether to transclude the subsections of the requested section", "example": "yes", "type": "boolean" },		"indicator": { "label": "Indicator", "description": "Whether to indicate the start and finish of the excerpt", "example": "yes", "type": "boolean" },		"tag": { "description": "Allows use of \"span\" rather than \"div\" for when you don't want a line break before or after the excerpt", "default": "div", "example": "span", "type": "string", "label": "Tag" },		"tables": { "label": "Tables", "description": "Determines whether to transclude tables or not", "example": "no", "type": "boolean", "default": "yes" },		"references": { "label": "References", "description": "Determines whether to transclude references or not", "example": "no", "type": "boolean", "default": "yes" }	},	"description": "This template is used for transcluding part of an article into another article.", "paramOrder": [ "1",		"2",		"fragment", "nohat", "indicator", "paragraphs", "files", "tables", "references", "subsections", "tag" ] }