Lua templating/Snippets

This page contains some quick lua snippets to help create modules.

General
Get template and transluding page arguments

Check if a lua table contains something

Get the title of the page that transcludes a page containing a lua invocation (parent frame) which is typically a template.

Text
Find a text within text.

Math
Round a number.

Date
Add days to a date.

Conditional statements
Returning a string on specific conditions can sometimes reduce code.