A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Scribunto/Victor's_API_proposal below:

Extension:Scribunto/Victor's API proposal - MediaWiki

Warning: This page is just a proposal, there is no guarantee that any of the functions listed here will ever be implemented. If any of them are implemented, there is no guarantee that they will do the same thing or that the order of the arguments will be the same. For documentation of functions which actually exist, see the Lua reference manual.

The aim of Scribunto Lua in-script API is to provide the scripts an interface to certain features of MediaWiki software which are written in PHP and most of which are not feasible to implement in Lua. The first-priority target is to provide access to all those interfaces which were previously exposed to parser as magic words and parser functions.

Here we try to keep to the table arguments convention whenever it is feasible. func{a, b, c} means that you should invoke function as func{a = "whatever", b = "argument", c = "trolling"}.

Whenever a property is defined, it is either read-only ([ro]), write-only ([wo]) or read-write ([rw]).

Provided interfaces[edit]

All interfaces are the part mw package.

The time is passed in a following structure, which extends over Lua's standard date/time structure:

The revision information is passed in the following structure:

The titles have a special object, which is described in an individual section below.

Detailed interface description[edit]

The query module has different configurable limit-related variables:

In case when the limit is exceeded, the error is thrown.

Unlike other packages, this is an object class. It may be returned by any API method or be constructed by user using one of the following constructors:

The title object has the following fields:

It also has the following methods:

This interface provides access to MediaWiki's advanced date and time handling, parsing and internationalization interfaces.

The ustring module provides UTF-8 strings manipulations. It aims to be similar to built-in string module in Lua; however, it extends it in some features and it does not provide pattern matching (a separate regular expression library will be provided for that later). Also, it does not provide an OOP interface to strings[1]. There are the following functions in the ustring library:

All functions index the offsets in string by codepoints, not bytes. If invalid UTF-8 is supplied, an error is raised.

For all ustring functions which accept target string as a first argument, a similar function with "u" prefix is provided in usual string metatable. For example, ustring.trim(str) may also be called as str:utrim().

  1. Such an interface was considered, but it is impossible to adequately implement it in pure Lua.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4