Jump to content

User:Johnuniq/invoke

From Wikipedia, the free encyclopedia

Usage

[edit]

In a sandbox:

  • {{user:johnuniq/invoke|module=MODULE|function=FUNCTION|template=TEMPLATE}}

The defaults are:

  • MODULE = Module:Age/sandbox
  • FUNCTION = age_generic (exported from the module)
  • TEMPLATE = age_ymd (defined in the specs table in age_generic)

For example:

  • {{user:johnuniq/invoke|module=convert|function=convert|12|kg}} → 12 kilograms (26 lb)*
  • {{user:johnuniq/invoke|1 June 2016|July 10, 2018}} → 2 years, 1 month and 9 days
  • {{user:johnuniq/invoke|template=age_ymwd|1 June 2016|July 10, 2018}} → 2 years, 1 month, 1 week and 2 days
  • {{user:johnuniq/invoke|function=JULIANDAY|1 June 2016}} → 2457541

This might be useful when testing a module intended to implement several templates. Tests could be performed without creating new templates.