This MediaWiki extension gives access to query special pages from Lua.
This extension requires MediaWiki and Scribunto.
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;
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
This extension is written by Alexander Mashin in 2024, and was inspired by a feature request by SD0001.