In my CheckList Example I recommended using a static include or customised lua loader when the same checklist table is to be added into multiple pages. Here's an example:
Lua Code:
ProjectXCheckList.lua
function CheckList(title, row_labels, col_labels)
O=title
for col = 1, #col_labels do
O=O .. " | " .. col_labels[col]
col_labels[col] = string.gsub(col_labels[col], "%d", function(d) return string.format("%c", d+64) end)
end
O=O .. "\n:--:"
for col = 1, #col_labels do
O=O .. "|:--:"
end
O=O .. "\n"
for row = 1, #row_labels do
O=O .. row_labels[row]
row_labels[row] = string.gsub(row_labels[row], "%d", function(d) return string.format("%c", d+64) end)
for col = 1, #col_labels do
O=O .. " | {{check " .. row_labels[row] .. col_labels[col] .. "}}"
end
O=O .. "\n"
end
return O
end
function split(stringarray, sep)
array={}; i=1
for str in string.gmatch(stringarray, "[^"..sep.."]+") do
array[i]=str; i=i+1
end
return array
end
Rows=split("row 1:row 2:row 3",":")
Cols=split("col 1:col 2:col 3",":")
Y=CheckList("Title", Rows, Cols)
S = "{{stylesheet CheckList.css}}\n"
Y = S .. Y
return (Y)
Usage:
{{lua ProjectXCheckList.lua}}
Benefits:
- This can easily be built into every page you want to see a particular checklist
- E.g. it could be added via a snippet, or included in a common header or footer
- If the details of what you want to see changes you only need to edit one page