Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:PUV line/doc

From Wikipedia, the free encyclopedia

Usage

[edit]

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:

data

[edit]

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]

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>}}