Template:Excerpt/doc
This is a documentation subpage for Template:Excerpt It may contain usage information, categories and other content that is not part of the original template page. |
This template uses Lua: |
This template uses TemplateStyles: |
This template is used for transcluding part of an article into another article. This template extends the capabilities of the built-in Help:Labeled section transclusion function.
Usage
Basic usage
{{Excerpt|Title of the article}}
— Transclude the lead section of an article (see example).{{Excerpt|Title of the article|Title of the section}}
— 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
1
orarticle
— Title of the article to transclude. Only required parameter. If no other parameters are used, the lead section will be transcluded (see example).2
orsection
— Title of the section to transclude (see example).fragment
— Name of the fragment to transclude. Must be marked with<section begin=Name of the fragment/>
and<section end=Name of the fragment/>
in the transcluded article (see example).nohat
— Hide the hatnote "This section is an excerpt from..."paragraphs
— Specify the paragraphs to transclude. For example1-3,5
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 withfragment
.files
— Specify the files to transclude. For example1-3,5
will transclude files 1, 2, 3 and 5. By default only the first file is transcluded. Doesn't work withfragment
.indicator
— 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 toyes
to cause it to show.references
— Determines whether to transclude references or not. By default all references are transcluded. Set tono
to prevent it.tables
— Determines whether to transclude tables or not. By default all tables are transcluded. Set tono
to prevent it.subsections
— Use together withsection
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.tag
— By default the excerpt is wrapped with<div>
tags. Set tospan
to wrap it with<span>
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:
- Open the article with {{Main}} in one tab, and the main article in another.
- Edit both.
- Copy the text of the section with {{Main}} and paste it below the introduction of the main article.
- Delete repeated content and adjust using common sense.
- Save the changes in the main article with an edit summary like: Bring content from [[Some article]].
- Back to the section with {{Main}}, delete all content and replace it for an excerpt.
- Save the changes in the section with an edit summary like: Move content to [[Main article]] and leave excerpt.
- Check for any problems with references and fix as needed.
Compared to #section
For simple cases of transcluding sections of articles, the {{#section}}, {{#section-x}}, and {{#section-h}} (abbreviated {{#lst}}, {{#lstx}}, and {{#lsth}})) parser functions can be used instead of this template. {{#lsth:article|section}} will transclude the section of "article" with the header "section", and {{#lsth:article}} will transclude the lead section of "article". Excerpting only specific paragraphs can be done by marking up the source article with <section>...</section>
tags and using {{#lst:fragmentname}} to transclude those fragments, which is equivalent to using the |fragment=
parameter with this template. <lsth>...</lsth>
can also be used to transclude everything but those fragments.
The text will not be trimmed of excess whitespace, there will not be a header (equivalent to |nohat=yes
, and all files, templates, tables, references, and subsections will be included unless the source article is marked up with <section>...</section>
, <noinclude>...</noinclude>
, or <onlyinclude>...</onlyinclude>
tags. Self links will appear in bold.
Examples
Lead section
{{Excerpt|Science}}
Science is a rigorous, systematic endeavor that builds and organizes knowledge in the form of testable explanations and predictions about the world.[1][2] Modern science is typically divided into three major branches:[3] the natural sciences (e.g., physics, chemistry, and biology), which study the physical world; the social sciences (e.g., economics, psychology, and sociology), which study individuals and societies;[4][5] and the formal sciences (e.g., logic, mathematics, and theoretical computer science), which study formal systems, governed by axioms and rules.[6][7] There is disagreement whether the formal sciences are science disciplines,[8][9][10] because they do not rely on empirical evidence.[11][9] Applied sciences are disciplines that use scientific knowledge for practical purposes, such as in engineering and medicine.[12][13][14]
The history of science spans the majority of the historical record, with the earliest written records of identifiable predecessors to modern science dating to Bronze Age Egypt and Mesopotamia from around 3000 to 1200 BCE. Their contributions to mathematics, astronomy, and medicine entered and shaped the Greek natural philosophy of classical antiquity, whereby formal attempts were made to provide explanations of events in the physical world based on natural causes, while further advancements, including the introduction of the Hindu–Arabic numeral system, were made during the Golden Age of India.[15]:{{{1}}}[16][17][18] Scientific research deteriorated in these regions after the fall of the Western Roman Empire during the early middle ages (400 to 1000 CE), but in the Medieval renaissances (Carolingian Renaissance, Ottonian Renaissance and the Renaissance of the 12th century) scholarship flourished again. Some Greek manuscripts lost in Western Europe were preserved and expanded upon in the Middle East during the Islamic Golden Age[19] and later by the efforts of Byzantine Greek scholars who brought Greek manuscripts from the dying Byzantine Empire to Western Europe in the Renaissance.
The recovery and assimilation of Greek works and Islamic inquiries into Western Europe from the 10th to 13th century revived "natural philosophy",[20][21][22] which was later transformed by the Scientific Revolution that began in the 16th century[23] as new ideas and discoveries departed from previous Greek conceptions and traditions.[24][25] The scientific method soon played a greater role in knowledge creation and it was not until the 19th century that many of the institutional and professional features of science began to take shape,[26][27] along with the changing of "natural philosophy" to "natural science".[28]
New knowledge in science is advanced by research from scientists who are motivated by curiosity about the world and a desire to solve problems.[29][30] Contemporary scientific research is highly collaborative and is usually done by teams in academic and research institutions,[31] government agencies, and companies.[32][33] The practical impact of their work has led to the emergence of science policies that seek to influence the scientific enterprise by prioritizing the ethical and moral development of commercial products, armaments, health care, public infrastructure, and environmental protection.Sources |
---|
|
Specific section
{{Excerpt|List of continents by population|South America}}
Total South America | ||
---|---|---|
Year | Pop. | ±% |
1950 | 113,739,000 | — |
1960 | 149,066,000 | +31.1% |
1970 | 193,486,000 | +29.8% |
1980 | 242,862,000 | +25.5% |
1990 | 297,869,000 | +22.6% |
2000 | 349,796,000 | +17.4% |
2010 | 397,085,000 | +13.5% |
2018 | 423,581,078 | +6.7% |
Specific fragment
{{Excerpt|2020 Republican Party presidential primaries|fragment=declared}}
Lua error: callParserFunction: function "#lst" was not found.
Sources |
---|
|
Notes |
---|
|
See also
- Wikipedia:Excerpts
- Category:Articles with excerpts, or Pages that link to "Template:Excerpt" (articles) (unsorted)
- Category:Articles with broken excerpts
- Help:Labeled section transclusion – A more efficient method for simple section transclusions
- Wikipedia:Transclusion#Selective transclusion – how to transclude one or more sections of an article or project page into another
- {{Transcluded section}} – creates hatnote but does not transclude the section
- {{Transcluded section2}} – creates hatnote and transcludes the section
- {{Transcluding article}} – transcludes one or more entire pages
- meta:Grants:Project/Rapid/Sophivorus/Excerpts - Grant to spread excerpts to various Wikipedias
Template data
This template is used for transcluding part of an article into another article.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Article | 1 article | Title of the article to transclude
| Page name | required |
Section | 2 section | Title of the section to transclude
| String | optional |
Fragment | fragment | Name of the fragment to transclude
| String | optional |
No hatnote | nohat | Whether to remove the hatnote
| Boolean | optional |
Indicator | indicator | Whether to indicate the start and finish of the excerpt
| Boolean | optional |
Paragraphs | paragraphs | What paragraphs to transclude
| String | optional |
Files | files | What files to transclude
| String | optional |
Tables | tables | Determines whether to transclude tables or not
| Boolean | optional |
References | references | Determines whether to transclude references or not
| Boolean | optional |
Subsections | subsections | Whether to transclude the subsections of the requested section
| Boolean | optional |
Tag | tag | Allows use of "span" rather than "div" for when you don't want a line break before or after the excerpt
| String | optional |