Module:BiologicalAgeBiomarkers: Difference between revisions

no edit summary
(Replaced content with "local p = {} local data = require('Module:BiologicalAgeBiomarkers/Data') local biomarkers = data.biomarkers local rows = data.rows local studies = data.studies function p.createCrossTable(frame) -- Start of the wiki table local wikitable = '{| class="wikitable"\n!' -- Column headers: Biomarker and System wikitable = wikitable .. ' System !! Biomarker' for _, study in pairs(studies) do wikitable = wikitable .. ' !! ' .. frame:expandTemp...")
Tag: Replaced
No edit summary
Line 6: Line 6:
local rows = data.rows
local rows = data.rows
local studies = data.studies
local studies = data.studies
function p.template(frame, name, arg)
return frame:expandTemplate({title = name, args = { arg }})
end


function p.createCrossTable(frame)
function p.createCrossTable(frame)
Line 14: Line 18:
     wikitable = wikitable .. ' System !! Biomarker'
     wikitable = wikitable .. ' System !! Biomarker'
     for _, study in pairs(studies) do
     for _, study in pairs(studies) do
         wikitable = wikitable .. ' !! ' .. frame:expandTemplate({title = "pmid", args = { study.pmid }})
         wikitable = wikitable .. ' !! ' .. p.template(frame, "pmid", study.pmid)
end
end
wikitable = wikitable .. '\n'
wikitable = wikitable .. '\n'
Line 23: Line 27:
         for _, study in ipairs(studies) do
         for _, study in ipairs(studies) do
             local cellValue = study[row.key] or ""
             local cellValue = study[row.key] or ""
wikitable = wikitable .. ' || ' .. cellValue
wikitable = wikitable .. ' || ' .. p.template(frame, "VerticleText", cellValue)
         end
         end
wikitable = wikitable .. '\n'
wikitable = wikitable .. '\n'