Module:Sandbox/User:Alsang: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
No edit summary |
No edit summary |
||
Line 48: | Line 48: | ||
out:tag('tr') |
out:tag('tr') |
||
:tag('th') |
:tag('th') |
||
:attr{ rowspan = '2' } |
|||
:wikitext('[[' .. page.name .. ']]') |
:wikitext('[[' .. page.name .. ']]') |
||
:done() |
|||
⚫ | |||
:wikitext('[[File:' .. page.name .. '.png]]') |
|||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
Line 72: | Line 70: | ||
:done() |
:done() |
||
:done() |
:done() |
||
⚫ | |||
end |
|||
return out |
|||
end |
|||
function p.main3() |
|||
local results = mw.smw.ask(p.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') |
:tag('td') |
||
:wikitext('[[File:' .. page.name .. ' (basic) dye.png]]') |
:wikitext('[[File:' .. page.name .. ' (basic) dye.png]]') |
||
Line 114: | Line 96: | ||
end |
end |
||
function p.carp() |
|||
local query = '[[Variant type::~*]] AND [[Category:Carpenter]] AND [[~*Post*]]|?#-=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:Coarse ' .. page.name .. '.png]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[File:Rugged ' .. page.name .. '.png]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[File:Average ' .. page.name .. '.png]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[File:Fine ' .. page.name .. '.png]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[File:Sturdy ' .. page.name .. '.png]]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[[File:Perfect ' .. page.name .. '.png]]') |
|||
:done() |
|||
:done() |
|||
end |
|||
return out |
|||
end |
|||
return p |
return p |
Revision as of 20:30, 1 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.
p = {}
p.query = '[[Category:Guardian Equipment]] AND [[Variant type::~*]] AND [[Category:Armorer]]|?#-=name|limit=500'
function p.main()
local results = mw.smw.ask(p.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
return out
end
function p.main2()
local results = mw.smw.ask(p.query)
local out = mw.html.create('table')
:addClass('wikitable sortable')
for _,page in ipairs(results) do
out:tag('tr')
:tag('th')
:attr{ rowspan = '2' }
: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()
:tag('tr')
:tag('td')
:wikitext('[[File:' .. page.name .. ' (basic) dye.png]]')
:done()
:tag('td')
:wikitext('[[File:' .. page.name .. ' (moderate) dye.png]]')
:done()
:tag('td')
:wikitext('[[File:' .. page.name .. ' (fine) dye.png]]')
:done()
:tag('td')
:wikitext('[[File:' .. page.name .. ' (strong) dye.png]]')
:done()
:tag('td')
:wikitext('[[File:' .. page.name .. ' (superior) dye.png]]')
:done()
:tag('td')
:wikitext('[[File:' .. page.name .. ' (perfect) dye.png]]')
:done()
:done()
end
return out
end
return p