Extension:InterwikiExtracts

InterwikiExtracts (formerly WikipediaExtracts) is an extension to reuse content from other wikis. It introduces the  parser function that gets content from any wiki defined in your interwiki table (actually, any wiki that has   defined, but most do).

The content can be returned in three formats: HTML, wikitext or plain text. See the section for details about each format.

HTML
By default, the extension gets content from Wikipedia in HTML format. So to get the HTML of any Wikipedia article, just 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, the redirect will be followed and the content of the target article will be returned. 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 by passing parameters to the parser function, using the familiar template syntax. For example:

Wikitext
You can get content in wikitext format with the following syntax:

The content will be parsed after getting it, which means that any links to pages in your wiki that don't exist yet will show red, including templates!

The wikitext format is unlikely to be useful with content from Wikipedia, but it may be more useful with content from smaller wikis, with less internal links and templates.

Plain text
To get content in plain text format, the target wiki needs to have the TextExtracts extension enabled. All Wikimedia wikis have it enabled, but other wikis may not!

To get content in plain text format, use the following syntax:

The available parameters are:


 * section – Title of the section to get (excluding subsections).
 * intro – Whether or not to get content only before the first section. Any value means true.
 * sentences – The number of sentences to get from the intro. Cannot be used together with the "chars" parameter.
 * chars – The number of characters you get. Cannot be used together with the "sentences" parameter.
 * 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 last 5 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 want to use the extension to get the introductions of Wikipedia articles, you could create a template called Template:WikipediaIntro with the following content:

Calling this template without any parameters will get the introduction of the Wikipedia article with the same title as the current page. If you want the introduction of a different article, you can specify the article through the first parameter, like so:

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

Calling this template without any parameters will get the first sentence of the Wikipedia article with the same title as the current page. If you want the first sentence of a different article, you can specify the article through the first parameter, and if you want more than one sentence, you can specify it through the second parameter, like so:

Crediting the authors
When using this extension, you should always credit the authors of the content you're reusing. You can easily do so by including a link in your template. For example:

[ From Wikipedia]