Jump to content

Module:Naval Vessel Register URL/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by RP88 (talk | contribs) at 00:32, 28 September 2016 (eliminate id param). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Summary

This module generates links to ships in the Naval Vessel Register (nvr.navy.mil) database. Intended to be used by:

Using this module from templates

This function returns a link to a ship in the Naval Vessel Register.

Usage:

{{#invoke:NVR|MakeShipLink|1=|title=}}
{{#invoke:NVR|MakeShipLink}}

Parameters:

1 — The 'file name' portion of the url path (typically the ship's hull designation) without the .HTM/.HTML extension.
2 or title — A title or label for the link.

Example:

{{#invoke:NVR|MakeShipLink|OLDIRON}} produces Script error: No such module "NVR".

This function returns a link to a service ship in the Naval Vessel Register.

Usage:

{{#invoke:NVR|MakeServiceShipLink|1=|title=}}
{{#invoke:NVR|MakeServiceShipLink}}

Parameters:

1 — The 'file name' portion of the url path (typically the ship's hull designation) without the .HTM/.HTML extension.
2 or title — A title or label for the link.

Example:

{{#invoke:NVR|MakeServiceShipLink|AFDB1_1}} produces Script error: No such module "NVR".

Using this module from Lua code

In order to use the functions in this module from another Lua module you first have to import this module.

Example:

local nvr = require('Module:NVR')

This function returns a link to a ship in the Naval Vessel Register. Usage:

link_string = nvr._MakeShipLink(nvrid, title)

Parameters:

nvrid — The 'file name' portion of the url path (typically the ship's hull designation) without the .HTM/.HTML extension, as a string..
title — Title for link, set to for a bare link without a title.

Example:

link_string = nvr._MakeShipLink('OLDIRON', '')

This function returns a link to a service ship in the Naval Vessel Register. Usage:

link_string = nvr._MakeServiceShipLink(nvrid, title)

Parameters:

nvrid — The 'file name' portion of the url path (typically the ship's hull designation) without the .HTM/.HTML extension, as a string..
title — Title for link, set to for a bare link without a title.

Example:

link_string = nvr._MakeServiceShipLink('AFDB1_1', '')

See Also