Page MenuHomePhabricator

Add the missing link from LUA interpreter to SVG rasterizer
Open, Needs TriagePublicFeature

Description

Feature summary: add the missing link from LUA interpreter to SVG rasterizer on wikimedia commons

Who would benefit:

  • all users (faster wikis)
  • users with older and simpler web browsers
  • WMF (decreased maintainance cost, bloat, and energy bills)
  • commons contributors and sysops (less mass-type content)
  • other contributors (easier to find desired image)

Problem:

Proposed solution:

  • allow to generate SVG by LUA modules accepting parameters, for all language, other details (such as background color, highlighting), and size (thus language and size would be controlled only by those parameters and nothing else)
  • for example, " https://commons.wikimedia.org/wiki/File:CompassRose_(mul)_16_blue_intercardinal.svg?lang=da " could be replaced by "File:CompassRose16|lang=da|bkg=blue|hl=intercardinal|width=200" ie only ONE file instead of 40
  • this does not require adding any new major technologies, but only the missing link from existing LUA interpreter to existing SVG rasterizer
  • this should be available on commons only in order to prevent further worsening of major problem T121470 staled forever
  • this is an alternative to T334372 inline SVG and has the benefit that the concept of rasterization of SVG is preserved, and support for inline SVG is not required from the browser
  • create a new namespace (preliminarily called "Gensvg:") on commons where LUA modules can be executed
  • prevent those "Gensvg:" modules from taking any other input than parameters such as "mw.site.stats" or "os.time" ie implement a strict principle "outcome depends on parameters and nothing else" in that namespace
  • prevent those "Gensvg:" modules from interacting with ordinary modules or templates
  • prevent those "Gensvg:" modules from outputting garbage, multilingual SVG, animated SVG, too small (say below 20px x 2px), too huge (say over 1000px x 1000px) and whatever is undesirable
  • restrict "Gensvg:" modules to one function per module
  • set up two methods for calling them, such as (any wiki) [[Gensvg:CompassRose16|lang=da|bkg=blue|hl=intercardinal|width=200]] for displaying the image (sent as PNG to the browser), as well as a method for testing with built-in "pre" such as (only commons) {{#gensvg:CompassRose16|lang=da|bkg=blue|hl=intercardinal|width=200}} diaplaying the generated SVG code
  • so my generator currently existing on my computer only would be at commons as "Gensvg:CompassRose16" where it would be much more useful
  • this does not affect existing LUA modules or existing SVG files (redundant files could and should be deleted via the ordinary deletion process)

This task is not of the type " add as many features as quickly as possible ", but of the type " improve the overall system efficiency ".