Page MenuHomePhabricator

[Lua task #2] Use Lua on English Wikipedia
Closed, DeclinedPublic


To work on this, you must have successfully finished the task "[Lua task #1] Set up your sandbox for programming in Lua on English Wikipedia" before!

A Wikipedia page can call a Lua module to do calculations, process text, format citations, fetch information from Wikidata, and many other jobs where a programming language is needed to get a result.

  1. A Lua module is used inside a Wikipedia page by using a call something like

Type or copy that line as a new line at the end of your sandbox (not your sandbox module) and save it. You should see the filename of a JPG image. The line makes use of a module called Module:RexxS. Modules can contain many functions and the line you have entered calls a function in that module called "carousel".

  1. Modify that line to read
[[File:{{#invoke:RexxS|carousel}} | thumb]]

and save it.
This uses the standard MediaWiki image syntax to display the image. You can read a lot more about image syntax if you are interested.

  1. Look at and examine the code. See if you can work out how the function picks a filename. You may find the documentation helpful to learn how Lua works.

In your sandbox, on a new line, write down the name of the list (a Lua table) that stores the filenames.

Event Timeline

RexxS created this task.Dec 6 2017, 9:04 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 6 2017, 9:04 PM
RexxS added a comment.Dec 6 2017, 10:29 PM

I will mentor this in Google-Code-in-2017

Aklapper renamed this task from Lua Task 2 - Using Lua in Wikipedia to [Lua task #2] Use Lua on English Wikipedia.Dec 7 2017, 3:40 PM
Aklapper updated the task description. (Show Details)
Aklapper moved this task from Proposed tasks to Imported in GCI Site on the Google-Code-in-2017 board.
Aklapper closed this task as Declined.Jan 17 2018, 6:29 PM

Closing this task as it was a placeholder in Phab for Google-Code-in-2017 which is ending these days (no more new tasks can be claimed from now on in GCI 2017).