|
|
Zeile 1: |
Zeile 1: |
| local p = {} | | local p = {} |
|
| |
| local function tableToString(t)
| |
| local key
| |
| local value
| |
| local result
| |
|
| |
| result = ''
| |
|
| |
| for key, value in pairs(t) do
| |
| if (tonumber(key) ~= nil) then
| |
| result = result .. ':table[' .. key .. '] is ' .. value .. '\n'
| |
| else
| |
| result = result .. ':table[\'' .. key .. '\'] is ' .. value .. '\n'
| |
| end
| |
| end
| |
|
| |
| return result
| |
| end
| |
|
| |
| function p.args(frame)
| |
| return ';args\n' .. tableToString(frame.args)
| |
| end
| |
|
| |
| function p.callParserFunction(frame)
| |
| return ';callParserFunction\n:' .. frame:callParserFunction('#time', 'Y-m-d H:i:s') .. '\n'
| |
| end
| |
|
| |
| function p.expandTemplate(frame)
| |
| return ';expandTemplate\n:' .. frame:expandTemplate({title = 'Template:Sandbox', args = {'arg1', 'arg2'}}) .. '\n'
| |
| end
| |
|
| |
| function p.extensionTag(frame)
| |
| return ';extensionTag\n:' .. frame:extensionTag('nowiki', '[[text]]', {}) .. '\n'
| |
| end
| |
|
| |
|
| function p.getParent(frame) | | function p.getParent(frame) |
Zeile 42: |
Zeile 8: |
| function p.getTitle(frame) | | function p.getTitle(frame) |
| return tostring(mw.title.getCurrentTitle()) | | return tostring(mw.title.getCurrentTitle()) |
| | end |
| | |
| | function p.getTS(frame) |
| | return frame:preprocess('{{REVISIONTIMESTAMP: '.. tostring(mw.title.getCurrentTitle()) ..'}}') |
| end | | end |
|
| |
|
| return p | | return p |