FANDOM


--local tableEngine = require('de.harry-grangers-test:Tables')
 
local p = {}
 
    function p.main()
        local tArgs = frame:getParent().args
 
        page = mw.title.new(tArgs[1])
 
        --local rows = {}
 
        --for i,v in pairs() do
            --table.insert(rows,getRow()) 
        --end
    end
 
    function p.mainTest(title)
        local tArgs = {title}
 
        page = mw.title.new(tArgs[1])
        content = page:getContent()
        lines = stringLines(content)
 
        --for i,v in pairs() do
            --table.insert(rows,getRow()) 
        --end
 
        return lines
    end
 
    function stringLines(str)
        local output = {}
 
        for i,v in string.gmatch(str,'(.*)\n?') do
            mw.log('i',i)
            table.insert(output,i)
        end
 
        return output
    end
 
    function getRow()
        local row = html.create('tr')
 
            for i,v in pairs() do
                row:node(getCell())
            end
 
        return row
    end
 
    function getCell()
        local cell = html:create('td')
 
        cell:wikitext()
 
        return cell
    end
 
return p