Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Data/doc

From Kerbal Space Program 2 Wiki
Revision as of 02:46, 30 November 2024 by KiwiShark (talk | contribs) (added additional function explanations and fixed example linking)

This is the documentation page for Module:Data

The Data module exists to translate information from Data: pages to templates/articles.

Arguments

<1> (Subject): This argument is taken as the title of the intended Data: page to search through.

<2+> (Parameter chain): Arguments 2 and beyond define the parameter chain to search on the data page.

Functions

getData: The primary function of the module. Accepts the full argument set to determine the parameter to return from the subject.

getFuelLabels: Used for engine infobox construction. Accepts a part name (only works for engines) for <1> and optionally "alt" for <2>. Returns a line-break separated list of the propellant names used by an engine mode. Should probably be moved to a different Module.

getFuelValues: Used for engine infobox construction. Accepts a part name (only works for engines) for <1> and optionally "alt" for <2>. Returns a line-break separated list of the propellant use rates of an engine mode. Should probably be moved to a different Module.

Examples

A list of example JSON sets can be found at Data:Example.

{{#invoke:Data|getData|LV-SW "SWERV"|mass}} - Returns the mass of the "SWERV" in tons, 10.00.

{{#invoke:Data|getData|LV-3000 "Tuba"|modules|engine|thrust|vac}} - Returns the vacuum thrust of the "Tuba" in kilonewtons, 510.0.

MediaWiki Appliance - Powered by TurnKey Linux