Module:PUV line/doc

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by imported>Ganmatthew at 08:43, 10 October 2025 (Created docs). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This module contains the main logic for Template:PUV line, which returns route data for the list of bus routes in Metro Manila.

Currently, there are two supported methods:

Calling the module directly will return a Lua table of the full data and the getColor function.

Module example (used in Module:PUV stop):

local PUVLine = require("Module:PUV line")
local data = PUVLine.data

The data table organizes public transport lines by service type. Each service type contains line details, optional images, and a reference article.

Keys:

  • service_type: string identifying the service (city, bgc, lovebus, qc, etc.)
  • route_id: string identifying the route (1, PNR 1, EX, etc.)
  • background_color: string hex code (including #)
  • type: the Rint bus icon type, valid values are bus or rapid
  • color: text color to contrast with background_color
  • image: optional array containing the filename and size in pixels to display for that service
  • article: optional string linking to a relevant article

getColor

[edit source]

Calling the getColor function returns the hex color code (without #) of a specific line in a service. The function takes two positional parameters:

  • The first positional parameter following getColor is the service key, which determines the set of routes that the stop is a part of. Valid keys are city, bgc, lovebus, and qc.
  • The second parameter is the letter or number used to identify a bus line of that service.

Module example:

local PUVLine = require("Module:PUV line")
local color = PUVLine.getColor("city", "1")

Template example (used in Template:PUV line):

{{#invoke:PUV line|getColor|<1>|<2>}}