Module:ShipPageTests

Revision as of 03:31, 7 March 2018 by がか (talk | contribs) (Created page with "local ShipPage = require('Module:ShipPage') function Gallery(ship) return ShipPage.Gallery(nil, { explicit = { ship = ship }, implicit = {} }) end function GalleryTabber...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:ShipPageTests/doc

local ShipPage = require('Module:ShipPage')

function Gallery(ship)
    return ShipPage.Gallery(nil, { explicit = { ship = ship }, implicit = {} })
end

function GalleryTabber(ship)
    return ShipPage.GalleryTabber(nil, { explicit = { ship = ship }, implicit = {} })
end

local Tests = {}

function Tests.GalleryAll(frame)
    local ShipIterator = require('Module:ShipIterator')
    local result = {}
    for _, ship in ShipIterator.base() do
        table.insert(result, '=[[' .. ship .. '/Gallery|' .. ship .. ']]=')
        table.insert(result, Gallery(ship))
    end
    return frame:preprocess(table.concat(result, '\n'))
end

function Tests.GalleryTabberAll(frame)
    local ShipIterator = require('Module:ShipIterator')
    local result = {}
    for _, ship in ShipIterator.base() do
        table.insert(result, '===[[' .. ship .. '/Gallery|' .. ship .. ']]===')
        table.insert(result, '<div class="ship-page-gallery" data-name="' .. ship .. '">')
        table.insert(result, GalleryTabber(ship))
        table.insert(result, '</div>')
    end
    return frame:preprocess(table.concat(result, '\n'))
end