Extension:PgnJS

PgnJS is a MediaWiki extension that displays and animates chess games (boards and moves). Chess games are simply given in PGN format in a  tag and displayed thanks to the powerful javascript engine PgnViewerJS. In fact most of the functionality is provided by PgnViewerJS. This extension only implements the parsing of the  tag.

Features and Examples

 * Four display modes:,  ,   and  , and one mode to define defaults.
 * Different layout possibilities (, ...).
 * Many attributes, including styling and classes.
 * Support for wiki templates.
 * Read default configuration from user preferences.
 * Internationalization support.

Visit the PgnJS page on WikiTest server for a detailed list of all features. There you can see the extension at work and try it by yourself!

Documentation and Source Code
Please visit the GitHub page.

Installation
The simplest is to clone the git repository in folder  of your wiki and run the   target (for MW 1.25 or above) or   (for MW 1.24 or older):

Don't forget the  option since the extension uses git submodules.

/  will delete all files that are not necessary for the extension to run, and add the following line at the end of  :

✅! Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Compatibility
Extension uses the ResourceLoader, so it requires at least MediaWiki 1.17.

The extension has been tested on
 * MediaWiki 1.22.1, 1.27.4, 1.32.6, 1.33.0, 1.33.4, 1.34.4, 1.35.0, 1.35.1.