Extension:WikipediaExtracts

The WikipediaExtracts extension allows you to insert content extracted directly from Wikipedia into any MediaWiki wiki. The content extracted comes in the form of limited wikitext, omitting leading templates, links to files or pages, etc., so it looks great on any wiki.

Usage
To insert the content of any Wikipedia article into any page, simply write:

If you omit the title, then the title of the current page will be used. If you enter the title of a redirect page, WikipediaExtracts will follow the redirect and extract the content of the target article. If the redirect is to a section of the target article it will extract the full article and not just the section.

You can control several aspects of the content you get from Wikipedia by passing parameters to the parser function, using the familiar template syntax. For example:

The available parameters are:


 * chars - The number of characters you get. Cannot be used together with the "sentences" parameter.
 * sentences - The number of sentences you get. Cannot be used together with the "chars" parameter.
 * intro - Whether or not to get content only before the first section. Any value means true.
 * plaintext - Whether or not to get content as plain text rather than limited HTML. Any value means true.
 * sectionformat - Either "plain", "wiki" or "raw". Default is "wiki".

The parameters are based on the API of the Extension:TextExtracts, check its documentation for more details.

Templates
Usually you'll want to wrap the parser function in a template, to simplify the syntax and set sensible defaults. For example, if you plan on using this extension for inserting the introductions of Wikipedia articles, you could create a template called Template:WikipediaIntro with the following content:

Calling this template without any parameters will insert the introduction of the Wikipedia article with the same title as the page you're currently at. If you want the introduction of a different article, you can pass the desired title through the first parameter, like so:

Similarly, if you want to use this extension for inserting mostly definitions extracted from Wikipedia, you could create a template called Template:WikipediaDefinition with the following content:

Calling this template without any parameters will insert the first sentence of the Wikipedia article with the same title as the page you're currently at. If you want the first sentence of a different article, you can pass the desired title through the first parameter, and if you want more than one sentence from the article, you can pass the second parameter, like so:

Crediting Wikipedia
When using this extension, you should credit Wikipedia for the extracted content. You can easily do so by including a link to Wikipedia at the bottom of your templates. For example:

Extracted from [ Wikipedia]

Or maybe with a "Read more..." message:

[ Read more...]