Page MenuHomePhabricator

Expose gadgets metadata to lua
Open, Needs TriagePublic

Description

Currently, lua can read gadget definitions by parsing MediaWiki:Gadgets-definition. Enwiki implements this in Module:Gadgets. Use cases:

  1. Showing which gadget(s) the current script page belongs to via an interface message. (Currently implemented in Module:Script doc auto)
  2. Having a templated part of the description message which indicates whether the gadget is default. (Currently this is maintained manually, eg. MediaWiki:Gadget-refToolbar)

The above would not be possible with the switch to JSON repo, as definitions are across multiple pages and lua does not have a way to list pages by contentmodel. To address this, we can expose gadgets' metadata natively to Scribunto.

Event Timeline

Change #1047603 had a related patch set uploaded (by SD0001; author: SD0001):

[mediawiki/extensions/Gadgets@master] Add lua library for retrieving gadgets metadata

https://gerrit.wikimedia.org/r/1047603

Change #1047718 had a related patch set uploaded (by SD0001; author: SD0001):

[integration/config@master] Add Scribunto as a phan dependency for Gadgets extension

https://gerrit.wikimedia.org/r/1047718

Change #1047718 merged by jenkins-bot:

[integration/config@master] Add Scribunto as a phan dependency for Gadgets extension

https://gerrit.wikimedia.org/r/1047718