Skip to content

A MediaWiki extension that exposes cached query pages to Lua

License

Notifications You must be signed in to change notification settings

alex-mashin/LuaSpecials

Repository files navigation

This MediaWiki extension gives access to query special pages from Lua.

Requirements

This extension requires MediaWiki and Scribunto.

Installation and configuration

To install,

cd extensions
git clone https://github.com/alex-mashin/LuaSpecials.git

To enable the extension, add to LocalSettings.php:

wfLoadExtension( 'LuaSpecials' );

The only configuration setting is $wgLuaSpecialsDefaultLimit, regulating, how much rows are fetched from the special page, if the limit is not specified in Lua module. Its default value is 50. To remove the limit, set

$wgLuaSpecialsDefaultLimit = false;

Usage

local long1_100 = mw.ext.luaSpecials.longpages (0, 100) -- fist 100 rows of Special:Longpages.
local long101_200 = mw.ext.luaSpecials.longpages (100, 100) -- next 100 rows.
local long = mw.ext.luaSpecials.longpages () -- first $wgLuaSpecialsDefaultLimit rows.

-- Get all available special pages:
local pages = {}
for special, func in pairs (mw.ext.luaSpecials) do
	pages [special] = func ()
end 

Credits

This extension is written by Alexander Mashin in 2024, and was inspired by a feature request by SD0001.

About

A MediaWiki extension that exposes cached query pages to Lua

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published