Talk:Lua scripting/Requirements

Latest comment: 12 years ago by Josh Parris in topic Access page metadata

Lifted from a discussion on Bot request on enwiki. Emphasis my own:

The massive switch in {{:en:template:Elo rating}} is extremely expensive to render. It is in many ways better to update the individual articles.
Tim Starling has recently commented on this, re: #switch basically being used to implement databases or key/value pairs. There's currently no upper limit on the number of switch cases you can have, but in the future an upper limit of 2000 may be set, so you should be aware of that. The issue when rendering is not the time it takes to parse (it's still very fast), but the amount of memory used, which can sometimes send the servers into swap on larger/more prevalent templates. For this particular template, I'd defer to Wikipedia:Don't worry about performance for the moment.

There's a requirement to think about. Josh Parris (talk) 01:01, 21 February 2012 (UTC)Reply

Access structured data edit

http://meta.wikimedia.org/wiki/New_Wikidata is being implemented by http://blog.bn2vs.com/2012/03/04/wikidata-wikipedia-2-0/ - Lua scripts will need to be able to access this structured data (for example, to populate an infobox).

Thought ought to be given to Semantic Wikimedia, whatever that is. Josh Parris (talk) 03:08, 7 March 2012 (UTC)Reply

Image output using SVG edit

SVG is relatively easy for a programming language to generate, and useful for generating charts and colour-coded maps from tables of data. I'm just not sure how you'd expose this as an image. Josh Parris (talk) 10:11, 7 March 2012 (UTC)Reply

Access page metadata edit

See w:Template talk:Unreferenced#Living people in which an editor bemoans the lack of access to the categories of the page upon which the template appears. Josh Parris (talk) 09:02, 12 March 2012 (UTC)Reply

That is bugzilla:18596 (parser function to detect if the current page is in a given category). Helder 13:15, 12 March 2012 (UTC)
So, metadata is a generalization of that bug. I'm not sure if the additional flexibility of accessing the metadata of any arbitrary page would help template devs, but as a generalization of accessing metadata it could be considered. Josh Parris (talk) 16:36, 12 March 2012 (UTC)Reply

Detect if a target of a redirect edit

Given that redirects are rendered differently to non-redirects, I assume it's possible for a script to know what redirect landed the reader on a page. #switchredirect would allow hatnotes to read

You arrived here from the XYZ redirect.  For other meanings of XYZ, see XYZ (disambiguation)

or

If you're looking for the dance troupe, see QZW (dancers)

on the same page, depending on the course of their arrival. 16:36, 12 March 2012 (UTC)

Return to "Lua scripting/Requirements" page.