Module:PUV line/doc
Jump to navigation
Jump to search
| This is a documentation subpage for Module:PUV line. It may contain usage information, categories and other content that is not part of the original module page. |
| This module is rated as beta. It is considered ready for widespread use, but as it is still relatively new, it should be applied with some caution to ensure results are as expected. |
Usage
[edit source]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 source]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
busorrapid - 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
getColoris the service key, which determines the set of routes that the stop is a part of. Valid keys arecity,bgc,lovebus, andqc. - 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>}}