<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Module%3AWPSHIPS_utilities%2Fdoc</id>
	<title>Module:WPSHIPS utilities/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://70.231.62.181/index.php?action=history&amp;feed=atom&amp;title=Module%3AWPSHIPS_utilities%2Fdoc"/>
	<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Module:WPSHIPS_utilities/doc&amp;action=history"/>
	<updated>2026-05-01T10:58:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>http://70.231.62.181/index.php?title=Module:WPSHIPS_utilities/doc&amp;diff=21698737&amp;oldid=prev</id>
		<title>imported&gt;Davidships: The prefix is optional (like the parenthetic dab) - see WP:SHIPNAME, which applies to article content as article names</title>
		<link rel="alternate" type="text/html" href="http://70.231.62.181/index.php?title=Module:WPSHIPS_utilities/doc&amp;diff=21698737&amp;oldid=prev"/>
		<updated>2024-08-30T21:48:15Z</updated>

		<summary type="html">&lt;p&gt;The prefix is optional (like the parenthetic dab) - see &lt;a href=&quot;/index.php?title=WP:SHIPNAME&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:SHIPNAME (page does not exist)&quot;&gt;WP:SHIPNAME&lt;/a&gt;, which applies to article content as article names&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{High-use}}&lt;br /&gt;
&lt;br /&gt;
==ship_name_format==&lt;br /&gt;
This function attempts to apply appropriate formatting to unformatted ship names.  The formats supported are:&lt;br /&gt;
#&amp;lt;(prefix)&amp;gt; &amp;lt;name&amp;gt; &amp;lt;(disambiguator)&amp;gt; where:&lt;br /&gt;
#*&amp;lt;(prefix)&amp;gt; (optional) – one from a list of defined prefixes commonly used for ships (ARA, HMS, USS, etc.); rendered in upright font&lt;br /&gt;
#*&amp;lt;name&amp;gt; – the ship&amp;#039;s proper name; rendered in italic font&lt;br /&gt;
#*&amp;lt;(disambiguator)&amp;gt; (optional) – typically the ship&amp;#039;s [[hull number|hull]] or [[pennant number]], or other disambiguator; always contained in parentheses; rendered in upright font&lt;br /&gt;
#&amp;lt;name&amp;gt; &amp;lt;(disambiguator)&amp;gt; where:&lt;br /&gt;
#*&amp;lt;name&amp;gt; – the ship&amp;#039;s proper name; rendered in italic font&lt;br /&gt;
#*&amp;lt;(disambiguator)&amp;gt; (required) – the ship&amp;#039;s [[hull number|hull]] or [[pennant number]] or a recognized ship-type descriptor; always contained in parentheses; rendered in upright font&lt;br /&gt;
#**hull and pennant numbers take two basic forms&lt;br /&gt;
#***uppercase letters, possibly followed by a space or hyphen, followed by digits (SSBN-659, R07, ON 688)&lt;br /&gt;
#***digits, possibly followed by a space or hyphen, followed by uppercase letters (401B)&lt;br /&gt;
#&amp;lt;nationality&amp;gt; &amp;lt;ship type&amp;gt; &amp;lt;name&amp;gt; &amp;lt;(disambiguator)&amp;gt; where:&lt;br /&gt;
#*&amp;lt;nationality&amp;gt; – one- or two- word nation name in adjectival form (Dutch, East Timorese, French, Ottoman, etc.); rendered in upright font&lt;br /&gt;
#*&amp;lt;ship type&amp;gt; – one from a list of one- to four-word phrases that describes a ship&amp;#039;s type ([[aviso]], [[brig sloop]], [[landing ship medium]], [[ship of the line]]); rendered in upright font&lt;br /&gt;
#*&amp;lt;name&amp;gt; – the ship&amp;#039;s proper name; rendered in italic font&lt;br /&gt;
#*&amp;lt;(disambiguator)&amp;gt; (optional) – typically the ship&amp;#039;s hull or pennant number, or other disambiguator; always contained in parentheses; rendered in upright font&lt;br /&gt;
&lt;br /&gt;
The function will also attempt to render ship-class names when the name is in the form:&lt;br /&gt;
*&amp;lt;name&amp;gt;-class &amp;lt;ship type&amp;gt; where:&lt;br /&gt;
**&amp;lt;name&amp;gt; – the class&amp;#039; proper name; rendered in italic font according to the setting of {{para|sclass}}&lt;br /&gt;
**&amp;lt;ship type&amp;gt; – a phrase that describes a ship&amp;#039;s type; rendered in upright font&lt;br /&gt;
&lt;br /&gt;
===Lists===&lt;br /&gt;
The function relies on three lists to accomplish its task.  These lists are:&lt;br /&gt;
#&amp;lt;code&amp;gt;ship_prefix_list&amp;lt;/code&amp;gt; – a list of commonly used ship prefixes initially taken from {{tlx|ship prefix}}; these are usually, but not always wholly uppercase&lt;br /&gt;
#&amp;lt;code&amp;gt;nationality_list&amp;lt;/code&amp;gt; – a list of nation names in their adjectival form; these are always capitalized; always one or two words&lt;br /&gt;
#&amp;lt;code&amp;gt;ship_type_list&amp;lt;/code&amp;gt; – a list ship-type descriptor phrases; these are usually, but not always wholly lowercase; always one to two words&lt;br /&gt;
&lt;br /&gt;
To add to any of these lists, the form is:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[&amp;#039;&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;addition&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;&amp;#039;] = true,&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
the trailing comma is important. See the instructions that accompany each list for limitations and implementation details.&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
The minimal form is:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:WPSHIPS_utilities|ship_name_format|name=}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Parameters====&lt;br /&gt;
The function requires one parameter and supports several optional parameters.&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;|name=&amp;#039;&amp;#039;&amp;#039; – (required) the name to format&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;|dab=none&amp;#039;&amp;#039;&amp;#039; – for use with {{para|infobox caption|nodab}} in {{tlx|infobox ship begin}}, excludes a disambiguator from the formatted name&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;|sclass=2&amp;#039;&amp;#039;&amp;#039; – for use with &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;DISPLAYTITLE}}&amp;lt;/code&amp;gt; and with {{para|infobox caption|yes}} or {{para|infobox caption|nodab}} in {{tld|infobox ship begin}}, when the class is not named for a member of the class; causes the class name to be rendered in upright font&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;|adj=off&amp;#039;&amp;#039;&amp;#039; – for use in ship-class articles with {{para|infobox caption|yes}} or {{para|infobox caption|nodab}} in {{tld|infobox ship begin}}, formats the class name in its noun form and excludes the ship type phrase and disambiguator&lt;br /&gt;
:&amp;#039;&amp;#039;&amp;#039;|showerrs=yes&amp;#039;&amp;#039;&amp;#039; – debug tool; not currently supported in any templates;&lt;br /&gt;
&lt;br /&gt;
====Wrapper template====&lt;br /&gt;
* {{tl|Ship name format}} is a wrapper template to make it easier for editors to label ships in the main body of articles or as &amp;#039;&amp;#039;input&amp;#039;&amp;#039; to templates or modules.  It supports the same parameters as the module.&lt;br /&gt;
* In most cases, {{tl|ship}} is preferred over using this wrapper template or this module.&lt;br /&gt;
* It is useful to set the DISPLAYTITLE of redirects, disambiguation pages, or other pages named after ships which do not use one of the other &amp;quot;ships&amp;quot; templates such as {{tl|Infobox ship begin}} to do this.  Example: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{DISPLAYTITLE:{{ship_name_format|name={{FULLPAGENAME}}}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Other templates and modules should not transclude this template, instead they should call the module directly.&lt;br /&gt;
* Wikipedia pages should not transclude this template many times, as it may cause the page to exceed Wikipedia&amp;#039;s [[Wikipedia:Template limits|template limits]].  Those pages should invoke the module directly.&lt;br /&gt;
&lt;br /&gt;
==wpsu.navsource()==&lt;br /&gt;
This function is the driver for {{tlx|navsource}}.  The function assembles an external wikilink from known fragments and positional parameter &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{{1}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.  A ship name provided in positional parameter &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{{2}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; is formatted using &amp;lt;code&amp;gt;ship_name_format()&amp;lt;/code&amp;gt;.  New with this implementation of {{tld|navsource}} is the addition of {{para|showerrs}}.  The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; in the template defaults to {{para|showerrs|yes}} which can be overridden by setting {{para|showerrs|no}} in the template.&lt;br /&gt;
&lt;br /&gt;
==wpsu.hnsa()==&lt;br /&gt;
Similar to {{tlx|navsource}}, this code supports {{tlx|hnsa}} by attempting to construct a link to a ship article at the Historic Naval Ships Association website.&lt;br /&gt;
&lt;br /&gt;
The template has the form:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{hnsa|&amp;lt;page&amp;gt;|&amp;lt;name&amp;gt;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
where:&lt;br /&gt;
:&amp;lt;page&amp;gt; is the name of the page from the url &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://hnsa.org/hnsa-ships/&amp;lt;page&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;name&amp;gt; (optional) is the name of the ship; if left blank, the template uses the current page title; if a ship name, it is formatted using &amp;lt;code&amp;gt;do_ship_name_format()&amp;lt;/code&amp;gt;&lt;br /&gt;
from which this code produces:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[http://hnsa.org/hnsa-ships/&amp;lt;page&amp;gt; &amp;lt;name&amp;gt;] at Historic Naval Ships Association&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox | |&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Davidships</name></author>
	</entry>
</feed>