dev

This module is deprecated in favour of Arguments.

Entrypoint templating wrapper for Scribunto packages. The module generates an entrypoint function that can execute Scribunto package calls in the template context. This allows a package to support both direct and template invocations.

Installation

Usage

The template entrypoint is inserted into the Scribunto package:

local entrypoint = require('Dev:Entrypoint')
local string = {}
string.main = entrypoint(string)
return string

The module can now be accessed by a MediaWiki template:

{{#invoke:string|main}}

The Scribunto module can now be used with the following syntax:

{{string|function|<one>|<two>|<...>}}

The sample documentation markup for the entrypoint function is as follows:

--- Template entrypoint for [[Template:String]].
--  @function           string.main
--  @param              {table} frame Scribunto frame in module context.
--  @return             {string} Module output in template context.

Documentation

Package function

entrypoint(package) (function)
Entrypoint templating wrapper for Scribunto packages.
Parameter: package Scribunto package. (table)
Errors:
  • 'you must specify a function to call' (line 85)
  • 'the function you specified did not exist' (line 91)
  • '$2 is not a function' (line 95; optional)
Returns: Template entrypoint - main. (function)

Other items

main(frame) (function)
Template entrypoint function generated by this module.
Parameter: frame Scribunto frame in module context. (Frame)
Returns: Module output in template context. (string)

Notes