Module:Sandbox/User:Alsang: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
No edit summary |
(Replaced content with "local p = {} function p.main() return end return p") Tag: Replaced |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
p = {} |
local p = {} |
||
function p.main() |
function p.main() |
||
local query = '[[Category:Hammermage Equipment]] AND [[Variant type::~*]]|?#-=name|limit=500' |
|||
local results = mw.smw.ask(query) |
|||
local out = mw.html.create('table') |
|||
:addClass('wikitable sortable') |
|||
for _,page in ipairs(results) do |
|||
out:tag('tr') |
|||
:tag('th') |
|||
:wikitext('[[' .. page.name .. ']]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[' .. page.name .. ' (basic)]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[' .. page.name .. ' (moderate)]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[' .. page.name .. ' (fine)]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[' .. page.name .. ' (strong)]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[' .. page.name .. ' (superior)]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[' .. page.name .. ' (perfect)]]') |
|||
:done() |
|||
:done() |
|||
end |
|||
⚫ | |||
end |
|||
⚫ | |||
function p.img() |
|||
local query = '[[Category:Hammermage Equipment]] AND [[Variant type::~*]]|?#-=name|limit=500' |
|||
local results = mw.smw.ask(query) |
|||
local out = mw.html.create('table') |
|||
:addClass('wikitable sortable') |
|||
for _,page in ipairs(results) do |
|||
out:tag('tr') |
|||
:tag('th') |
|||
:wikitext('[[' .. page.name .. ']]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[File:' .. page.name .. ' (basic).png]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[File:' .. page.name .. ' (moderate).png]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[File:' .. page.name .. ' (fine).png]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[File:' .. page.name .. ' (strong).png]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[File:' .. page.name .. ' (superior).png]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[File:' .. page.name .. ' (perfect).png]]') |
|||
:done() |
|||
:done() |
|||
end |
|||
return out |
|||
end |
end |
Latest revision as of 12:51, 6 January 2025
Module documentation
This documentation is transcluded from Module:Sandbox/User:Alsang/doc. [edit] [history] [purge]
This module does not have any documentation. Please consider adding documentation at Module:Sandbox/User:Alsang/doc. [edit]
Module:Sandbox/User:Alsang's function main is invoked by Template:Sandbox/User:Alsang.