Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Latest commit

 

History

History
executable file
·
57 lines (39 loc) · 1.32 KB

File metadata and controls

executable file
·
57 lines (39 loc) · 1.32 KB

This is a draft MediaWiki extension that allows you to use OOJS-UI widgets in wiki pages.

It's intended to be used to generate a living style guide for MediaWiki.

Installation

Run composer to get dependencies.

composer install

Add the following line to LocalSettings.php and navigate to Special:Version to confirm installation.

require_once( "$IP/extensions/OOUIPlayground/OOUIPlayground.php" )

Note: Also ensure the templates folder is writable so that compiled templates can be cached on disk.

What this extension does

This extension adds two tags to MediaWiki:

<ooui-demo>

This tag accepts the parameters for the OOUI Widget, either as attributes, or as JSON contents. The two options may be mixed.

The special attribute 'type' specifies what type of widget it is. This is generally the name of the widget class, minus the 'Widget' suffix.

Example:

<ooui-demo type="button">
{
	"disabled" : "true",
	"label" : "Button"
}
</ooui-demo>

The tag will display the widget, and on the right-hand-side will display the code used to create such a widget.

<ooui-doc>

This tag accepts the type of OOUI Widget (in the 'type' attribute), and displays a table of parameters accepted for that widget.

Example:

<ooui-doc type="button" />