dev

This module contains helper functions for dealing with frame objects.

Documentation

Package items

frameTools.copy(frame) (function)
Frame methods are protected by a checkSelf function, which makes them more difficult to copy.
Parameter: frame The frame of pseudo-frame to copy. (Frame|PseudoFrame)
Returns: (PseudoFrame)
frameTools.preprocessMock() (function)
Stub of the Frame:preprocess method that stringifies text or a Lua table.
Parameter: (Frame|PseudoFrame)
Returns: (string)
frameTools.extensionTagMock() (function)
Stub of the Frame:extensionTag method - returns a MediaWiki extension tag.
Parameter: (Frame|PseudoFrame)
Returns: (string)
frameTools.expandTemplateMock() (function)
Mock of the Frame:expandTemplate method that generates the text of template call.
Parameter: (Frame|PseudoFrame)
Returns: (string)
frameTools.makePseudoFrame(frame, parentArgs, childArgs) (function)
Creates a pseudo frame with some useful functions available in mw:Extension:Scribunto, e. g. newChild.
Parameters:
  • frame The frame that provides implementatinos for the preprocess method. (Frame; optional)
  • parentArgs The parameters available on pseudoFrame:getParent().args (table; optional)
  • childArgs The parameters available on pseudoFrame.args (table; optional)
Returns: The new pseudo-Frame (PseudoFrame)
frameTools.removeArgs(frame, ...) (function)
Returns a frame-like object with the given arguments removed.
Parameters:
  • frame The Frame to copy (Frame|PseudoFrame)
  • ... The arguments to omit from the new Frame's args property (optional)
Returns: (PseudoFrame)

PseudoFrame

A frame-like object that provides mock implementations for the most common mw. frame instance methods and properties