https://github.com/liquipedia/variableslua
A Scribunto Lua interface for Extension:Variables
https://github.com/liquipedia/variableslua
liquipedia mediawiki mediawiki-extension scribunto
Last synced: 9 months ago
JSON representation
A Scribunto Lua interface for Extension:Variables
- Host: GitHub
- URL: https://github.com/liquipedia/variableslua
- Owner: Liquipedia
- License: mit
- Created: 2018-04-19T13:15:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-24T12:18:45.000Z (over 1 year ago)
- Last Synced: 2025-03-27T06:12:11.140Z (10 months ago)
- Topics: liquipedia, mediawiki, mediawiki-extension, scribunto
- Language: PHP
- Homepage: https://liquipedia.net
- Size: 29.3 KB
- Stars: 8
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VariablesLua

This extension makes Extension:Variables work with Scribunto Lua. See https://liquipedia.net/commons/Help:VariablesLua for more information.
# Installation
* Extract the extension folder to extensions/VariablesLua/
* Add the following line to LocalSettings.php:
```
wfLoadExtension( 'VariablesLua' );
```
# Dependencies
This extension requires Extension:Variables and Extension:Scribunto to be installed.
# Examples
This is how some example calls to the extension could look like in a Scribunto module
```lua
local p = {} -- p stands for package
function p.get(frame)
local data = mw.ext.VariablesLua.var('variablename')
-- data now holds the value of the variable "variablename"
return data
end
function p.set(frame)
mw.ext.VariablesLua.vardefine('variablename', 'variablevalue')
-- The variable "variablename" now holds the value "variablevalue"
end
function p.setecho(frame)
local data = mw.ext.VariablesLua.vardefineecho('variablename', 'variablevalue')
-- The variable "variablename" now holds the value "variablevalue"
-- data now has the value "variablevalue"
return data
end
return p
```