Difference between revisions of "Template:IP-user other/core/doc"

From blackwiki
Jump to navigation Jump to search
imported>Davidgothberg
(Adding some technical documentation for this subtemplate.)
 
imported>Davidgothberg
(Removing {{lua|Module:IPAddress}} .)
 
(4 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
== Technical details ==
 
== Technical details ==
  
This subtemplate must be given the parameter "page" that should be a rootpage name without namespace. It returns one of two strings: "'''IP-user'''" or "'''other'''".
+
This subtemplate must be given the parameter "page" that should be a rootpage name without namespace. It returns one of three strings: "'''IPv4'''", "'''IPv6'''", or "'''other'''".
  
 
For instance this:
 
For instance this:
:<nowiki>{{IP-user other/core|page=Somepage}}</nowiki>
+
:<code><nowiki>{{IP-user other/core|page=Somepage}}</nowiki></code>
 
Returns this:
 
Returns this:
 
:{{IP-user other/core|page=Somepage}}
 
:{{IP-user other/core|page=Somepage}}
 
And this:
 
And this:
:<nowiki>{{IP-user other/core|page=201.83.25.59}}</nowiki>
+
:<code><nowiki>{{IP-user other/core|page=201.83.25.59}}</nowiki></code>
 
Returns this:
 
Returns this:
 
:{{IP-user other/core|page=201.83.25.59}}
 
:{{IP-user other/core|page=201.83.25.59}}
 
And this:
 
And this:
:<nowiki>{{IP-user other/core|page=2001:B011:7009:18A0:FC2F:9F5F:5B46:306E}}</nowiki>
+
:<code><nowiki>{{IP-user other/core|page=2001:B011:7009:18A0:FC2F:9F5F:5B46:306E}}</nowiki></code>
 
Returns this:
 
Returns this:
 
:{{IP-user other/core|page=2001:B011:7009:18A0:FC2F:9F5F:5B46:306E}}
 
:{{IP-user other/core|page=2001:B011:7009:18A0:FC2F:9F5F:5B46:306E}}
 +
 +
And this:
 +
:<code><nowiki>{{IP-user other/core|page=2001:470:FD:3:0:0:0:80}}</nowiki></code>
 +
Returns this:
 +
:{{IP-user other/core|page=2001:470:FD:3:0:0:0:80}}
  
  

Latest revision as of 22:44, 27 December 2019

This is the {{IP-user other/core}} sub-template.

Do not use this template directly; use {{IP-user other}} instead.

This template is called by {{IP-user other}}. It holds most of the code for {{IP-user other}}, while {{IP-user other}} itself performs parameter preprocessing.

Technical details

This subtemplate must be given the parameter "page" that should be a rootpage name without namespace. It returns one of three strings: "IPv4", "IPv6", or "other".

For instance this:

{{IP-user other/core|page=Somepage}}

Returns this:

other

And this:

{{IP-user other/core|page=201.83.25.59}}

Returns this:

IPv4

And this:

{{IP-user other/core|page=2001:B011:7009:18A0:FC2F:9F5F:5B46:306E}}

Returns this:

IPv6

And this:

{{IP-user other/core|page=2001:470:FD:3:0:0:0:80}}

Returns this:

IPv6


For more documentation, see {{IP-user other}} and its talkpage.