This is a documentation subpage for Module:Naval Vessel Register URL. It may contain usage information, categories and other content that is not part of the original module page. |
This module generates links to ships in the Naval Vessel Register (nvr.navy.mil) database. Intended to be used by:
NVR have adopted a file naming convention based on a ship's hull classification symbol with an appended underscore and some number of digits. The extra digits do not seem to follow an identifiable pattern so the former rules-based system used here no longer works.
To get round the 'new' file format, this version of the module adopts a brute-force mechanism by using a local database that maps a ship's hull classification symbol to its associated NVR file name. The database is two large Lua tables maintained at Module:Naval Vessel Register URL/data.
This function returns a link to a ship's page at the Naval Vessel Register website.
Usage:
((#invoke:Naval Vessel Register URL|MakeShipLink|id=|title=))
((#invoke:Naval Vessel Register URL|MakeShipLink))
— uses the calling template's parametersParameters:
Examples:
((#invoke:Naval Vessel Register URL|MakeShipLink|DDG_1000))
produces http://www.nvr.navy.mil/SHIPDETAILS/SHIPSDETAIL_DDG_1000.HTML((#invoke:Naval Vessel Register URL|MakeShipLink|constitution))
produces http://www.nvr.navy.mil/SHIPDETAILS/SHIPSDETAIL_1315.HTML((#invoke:Naval Vessel Register URL|MakeShipLink|maine|USS ''Maine''))
produces USS MaineThis function returns a link to a service craft in the Naval Vessel Register.
Usage:
((#invoke:Naval Vessel Register URL|MakeServiceCraftLink|id=|title=))
((#invoke:Naval Vessel Register URL|MakeServiceCraftLink))
— uses the calling template's parametersParameters: Parameters:
Examples:
((#invoke:Naval Vessel Register URL|MakeServiceCraftLink|AFDB-7F))
produces http://www.nvr.navy.mil/SHIPDETAILS/SHIPSDETAIL_AFDB_7_1549.HTML((#invoke:Naval Vessel Register URL|MakeServiceCraftLink|ytb-760))
produces Natick