Module:Library Listing

From Comprehensible Input Wiki

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

local p = {}

function createTable()

    local g = mw.ext.externaldata.getWebData {
        url = 'https://comprehensibleinputwiki.com/api.php?count=true',
        data = {language, count},
        format = 'JSON'
    }

    tableOut = '<table id="library-listing" class="wikitable" style="margin-left:auto;margin-right:auto"><tr id="lib-header"><th>Language</th><th>Video Count</th></tr>'

    for key, value in ipairs(g) do
        tableOut = tableOut .. '<tr><td>[[' .. value['language'] .. '/Library|' .. value['language'] .. ']]</td><td>' .. value['count'] .. '</td></tr>'
    end

    tableOut = tableOut .. '</table>'

    return tableOut

end



p.showList = function()
	return createTable()
end


return p