Module:JournalInfobox: verschil tussen versies
Uiterlijk
Geen bewerkingssamenvatting Label: Handmatige ongedaanmaking |
Geen bewerkingssamenvatting |
||
| Regel 2: | Regel 2: | ||
function p.infobox(frame) | function p.infobox(frame) | ||
local args = frame | -- Use frame.args for direct template calls | ||
local args = frame.args | |||
local title = args["title"] or "Unknown" | local title = args["title"] or "Unknown" | ||
local year = args["year"] or "" | local year = args["year"] or "" | ||
| Regel 8: | Regel 9: | ||
local ocr = args["ocr"] or "" | local ocr = args["ocr"] or "" | ||
local out = '{| class=" | -- Start table | ||
out = out .. '|-\n! colspan="2" style="background:#ddd;" | ' .. title .. '\n' | local out = '{| class="wikitable" style="width:300px; border:1px solid #aaa; background:#f9f9f9;"\n' | ||
out = out .. '|-\n! colspan="2" style="background:#ddd; text-align:center;" | ' .. title .. '\n' | |||
-- Add rows if parameters exist | |||
if year ~= "" then | if year ~= "" then | ||
out = out .. '|-\n| Year || ' .. year .. '\n' | out = out .. '|-\n| Year || ' .. year .. '\n' | ||
| Regel 19: | Regel 23: | ||
out = out .. '|-\n| OCR Extract || ' .. ocr .. '\n' | out = out .. '|-\n| OCR Extract || ' .. ocr .. '\n' | ||
end | end | ||
-- Close table | |||
out = out .. '|}' | out = out .. '|}' | ||
Versie van 10 dec 2025 18:19
Documentatie voor deze module kan aangemaakt worden op de volgende pagina: Module:JournalInfobox/doc
local p = {}
function p.infobox(frame)
-- Use frame.args for direct template calls
local args = frame.args
local title = args["title"] or "Unknown"
local year = args["year"] or ""
local pages = args["pages"] or ""
local ocr = args["ocr"] or ""
-- Start table
local out = '{| class="wikitable" style="width:300px; border:1px solid #aaa; background:#f9f9f9;"\n'
out = out .. '|-\n! colspan="2" style="background:#ddd; text-align:center;" | ' .. title .. '\n'
-- Add rows if parameters exist
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
-- Close table
out = out .. '|}'
return out
end
return p