Module:ImperialDocBuilder

From Imperial Republic Library
Revision as of 01:46, 20 April 2025 by Ryan (talk | contribs) (Created page with "local p = {} local function field(label, value) return '|-\n! ' .. label .. ' || ' .. (value or 'N/A') end -- PROTOCOL TEMPLATE function p.renderProtocol(frame) local args = frame:getParent().args local output = {} table.insert(output, '{| class="wikitable" style="width:100%; background:#f8f9fa;"') table.insert(output, '|+ style="font-size:130%; font-weight:bold;" | ' .. (args.subject or 'Protocol Document')) table.insert(output, field('Document ID', args.id))...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

local p = {}

local function field(label, value) return '|-\n! ' .. label .. ' || ' .. (value or 'N/A') end

-- PROTOCOL TEMPLATE function p.renderProtocol(frame) local args = frame:getParent().args local output = {}

table.insert(output, '{| class="wikitable" style="width:100%; background:#f8f9fa;"') table.insert(output, '|+ style="font-size:130%; font-weight:bold;" | ' .. (args.subject or 'Protocol Document'))

table.insert(output, field('Document ID', args.id)) table.insert(output, field('Issuing Authority', args.issuer)) table.insert(output, field('Date of Issue', args.date)) table.insert(output, field('Classification Level', args.classification)) table.insert(output, field('Status', args.status)) table.insert(output, field('Purpose', args.purpose))

table.insert(output, '|}') return table.concat(output, '\n') end

-- DIRECTIVE TEMPLATE function p.renderDirective(frame) local args = frame:getParent().args local output = {}

table.insert(output, '{| class="wikitable" style="width:100%; background:#f8f9fa;"') table.insert(output, '|+ style="font-size:130%; font-weight:bold;" | Executive Directive')

table.insert(output, field('Directive ID', args.id)) table.insert(output, field('Issued by', args.issuer)) table.insert(output, field('Date of Issue', args.date)) table.insert(output, field('Classification', args.classification)) table.insert(output, field('Subject', args.subject)) table.insert(output, field('Purpose', args.purpose))

for i = 1, 5 do if args['directive' .. i] then table.insert(output, field('Directive ' .. i, args['directive' .. i])) end end

for i = 1, 3 do if args['recipient' .. i] then table.insert(output, field('Recipient ' .. i, args['recipient' .. i])) end end

table.insert(output, '|}') return table.concat(output, '\n') end

-- LAW TEMPLATE function p.renderLaw(frame) local args = frame:getParent().args local output = {}

table.insert(output, '{| class="wikitable" style="width:100%; background:#f8f9fa;"') table.insert(output, '|+ style="font-size:130%; font-weight:bold;" | Imperial Republic Law')

table.insert(output, field('Law ID', args.id)) table.insert(output, field('Sponsor', args.sponsor)) table.insert(output, field('Date Introduced', args.date)) table.insert(output, field('Effective Date', args.effectdate)) table.insert(output, field('Filed by', args.filedby)) table.insert(output, field('Approver', args.approver)) table.insert(output, field('Preamble', args.preamble))

for i = 1, 5 do if args['article' .. i .. 'title'] then table.insert(output, '|-') table.insert(output, '| colspan=2 style="font-weight:bold;" | Article ' .. i .. ': ' .. args['article' .. i .. 'title']) for j = 1, 10 do if args['clause' .. i .. j] then table.insert(output, field('Clause ' .. i .. '.' .. j, args['clause' .. i .. j])) end end end end

table.insert(output, '|}') return table.concat(output, '\n') end

-- MILITARY ORDER TEMPLATE function p.renderOrder(frame) local args = frame:getParent().args local output = {}

table.insert(output, '{| class="wikitable" style="width:100%; background:#f8f9fa;"') table.insert(output, '|+ style="font-size:130%; font-weight:bold;" | Military Field Order')

table.insert(output, field('Order ID', args.id)) table.insert(output, field('Commander', args.commander)) table.insert(output, field('Date', args.date)) table.insert(output, field('Sector', args.sector)) table.insert(output, field('Objective', args.objective)) table.insert(output, field('Orders', args.orders)) table.insert(output, field('Rules of Engagement', args.roes)) table.insert(output, field('Remarks', args.remarks))

table.insert(output, '|}') return table.concat(output, '\n') end

-- REPORT TEMPLATE function p.renderReport(frame) local args = frame:getParent().args local output = {}

table.insert(output, '{| class="wikitable" style="width:100%; background:#f8f9fa;"') table.insert(output, '|+ style="font-size:130%; font-weight:bold;" | Intelligence or Incident Report')

table.insert(output, field('Report ID', args.id)) table.insert(output, field('Filed by', args.agent)) table.insert(output, field('Date', args.date)) table.insert(output, field('Priority Level', args.priority)) table.insert(output, field('Subject', args.subject)) table.insert(output, field('Summary', args.summary)) table.insert(output, field('Details', args.details))

for i = 1, 5 do if args['recipient' .. i] then table.insert(output, field('Recipient ' .. i, args['recipient' .. i])) end end

table.insert(output, '|}') return table.concat(output, '\n') end

-- INQUEST TEMPLATE function p.renderInquest(frame) local args = frame:getParent().args local output = {}

table.insert(output, '{| class="wikitable" style="width:100%; background:#f8f9fa;"') table.insert(output, '|+ style="font-size:130%; font-weight:bold;" | High Inquisition Summary')

table.insert(output, field('Case ID', args.id)) table.insert(output, field('Judge', args.judge)) table.insert(output, field('Defendant', args.defendant)) table.insert(output, field('Charges', args.charges)) table.insert(output, field('Evidence Summary', args.evidence)) table.insert(output, field('Verdict', args.verdict)) table.insert(output, field('Notes', args.notes))

table.insert(output, '|}') return table.concat(output, '\n') end

return p