Extension:PgnJS

Category:Extensions without a compatibility policyCategory:Apache licensed extensions
MediaWiki extensions manual
PgnJS
Release status: betaCategory:Beta status extensions
Implementation Parser function Category:Parser function extensions
Description display and animate chess games (boards and moves) given in <pgn> tags
Author(s) Michaël Peeters (xeyownttalk)
Latest version 0.5.1 (2021-02-07)
MediaWiki 1.17+Category:Extensions with manual MediaWiki version
License Apache License 2.0
Download Category:Extensions in GitHub version control
Example see WikiTest PgnJS page.
Category:All extensionsCategory:Extensions not in ExtensionJson

The PgnJS extension displays and animates chess games (boards and moves). Chess games are simply given in PGN format in a <pgn> 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 <pgn> tag.

Features and Examples

  • Four display modes: board, view, print and edit, and one mode to define defaults.
  • Different layout possibilities (left, top...).
  • 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 extensions of your wiki and run the install target (for MW 1.25 or above) or install-1.24 (for MW 1.24 or older):

cd /path/to/your/wiki/extensions
git clone --recursive --depth 1 https://github.com/xeyownt/mwpgnjs PgnJS
cd PgnJS
make install             # For MW 1.25 or above
make install-1.24        # For MW 1.24 or older

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

make install / make install-1.24 will delete all files that are not necessary for the extension to run, and add the following line at the end of LocalSettings.php:

// For MW 1.25 or above:
wfLoadExtension( 'PgnJS' );
// For MW 1.24 or older:
require_once "$IP/extensions/PgnJS/PgnJS.php";

Yes Done! 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.

See also

Category:All extensions Category:Apache licensed extensions Category:Beta status extensions Category:Extensions in GitHub version control Category:Extensions not in ExtensionJson Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:GetPreferences extensions Category:ParserFirstCallInit extensions Category:Parser function extensions Category:SaveUserOptions extensions Category:UserSaveOptions extensions