Skip to content

Import a Wikipedia article in your website using the Mediawiki API.

Notifications You must be signed in to change notification settings

chrisbo246/mediawiki-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

-={ mediawiki-loader }=- DEMO

Import a Wikipedia article in your website using the Mediawiki API.

Features

  • Import a full article in a container.
  • Fix links.
  • Remove unnecessary text (contribution links, messages, etc...)
  • Generate an excerpt without additional request.

Requirements

  • jQuery

Install

Using Bower (or download the zip from Github).

bower install --save chrisbo246/mediawiki-loader

Load the mediawiki-loader.js script.

<script src="/bower_components/mediawiki-loader/src/scripts/mediawiki-loader.js"></script>

Import the variables.scss and mediawiki-loader.scss in your SASS file to cleanup the article of every Wikipedia annotations and make small style adjustments.

@import "/bower_components/mediawiki-loader/src/styles/variables.scss";
@import "/bower_components/mediawiki-loader/src/styles/mediawiki-loader.scss";

Usage

Add a container with .mediawiki-container class and a data-url.

<div class="mediawiki-container" data-url="https://en.wikipedia.org/wiki/Google"></div>

If you need an excerpt on the same page without having to make a second request, simply add a second container with a .mediawiki-excerpt class.

<div class="mediawiki-excerpt"></div>

Don't forget to insert the required mention to the Wikipedia article.

<div class="mediawiki-mention">
    <a href="https://en.wikipedia.org/wiki/Google" target="_blank">https://en.wikipedia.org/wiki/Google</a>
</div>

Bugs

Please use the GitHub issue tracker for all bugs and feature requests. Before creating a new issue, do a quick search to see if the problem has been reported already.

About

Import a Wikipedia article in your website using the Mediawiki API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published