New extension: Include WP

Somewhere in the last two weeks I quickly wrote up a small new MediaWiki extension to include content from Wikipedia or some other MediaWiki install into pages on your wiki. It’s titled Include WP.

The extension does not import anything (so nothing is stored), but rather fetches content from the remote wiki every time the page is loaded. This means it takes a second or two for it to actually load, but ensures you got the latest content. Some clean up of the remote content happens and there are several options that allow you to customize how the included content is displayed. It makes use of the Validator extension.

Feature overview:

  • Include articles from Wikipedia or any other MediaWiki wiki into your pages.
  • Show only a limited amount of paragraphs on page load, with an option to show the full article.
  • Partial conversion to plain-text.
  1. Removal of templates (such as infoboxes), ref tags, comments, categories and images.
  2. Both internal and external links are rendered as plain-text.
  3. Tables, lists, table of content, section headers and more are retained.
  • Usage of the MediaWiki Resource Loader when available with backward support for MW 1.16.x.

Some screenshots 🙂

An included article, initially only showing a limited amount of paragraphs

An included article shown in a div with overflow (scrollbar) after requesting more content
Download

2 thoughts on “New extension: Include WP”

  1. Stupid question, how is this different from the scary interwiki transclude feature in core?

  2. I don’t really know the feature in core, so can’t tell. I suspect it saves the transcluded content locally though. In any case, I’d like to have a look at the core stuff; where are the docs? Search for “interwiki translcusion” on mediawiki.org not yielding anything useful-looking.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.