Naar inhoud springen

Module:JournalInfobox

Uit CostaSano-Wiki
Versie door Mngr (overleg | bijdragen) op 10 dec 2025 om 16:59 (First infobox layout with lua for old papers)
(wijz) ← Oudere versie | Huidige versie (wijz) | Nieuwere versie → (wijz)

local p = {}

function p.infobox(frame)

   local args = frame:getParent().args
   local title = args["title"] or "Unknown"
   local year  = args["year"] or ""
   local pages = args["pages"] or ""
   local ocr   = args["ocr"] or ""
   local out = '{| class="infobox" style="width:250px; border:1px solid #aaa; background:#f9f9f9;"\n'
   out = out .. '|-\n! colspan="2" style="background:#ddd;" | ' .. title .. '\n'
   if year ~= "" then
       out = out .. '|-\n| Year || ' .. year .. '\n'
   end
   if pages ~= "" then
       out = out .. '|-\n| Pages || ' .. pages .. '\n'
   end
   if ocr ~= "" then
       out = out .. '|-\n| OCR Extract || ' .. ocr .. '\n'
   end
   out = out .. '|}'
   return out

end

return p