Difference between revisions of "Template:IPaddr/doc"
imported>Dandorid |
imported>Dandorid (moved whitespace) |
||
| Line 1: | Line 1: | ||
==Introduction== | ==Introduction== | ||
Template <code><nowiki>{{IPaddr}}</nowiki></code> is used to make an [[IP address]] stand out in the text, to improve readability. | Template <code><nowiki>{{IPaddr}}</nowiki></code> is used to make an [[IP address]] stand out in the text, to improve readability. | ||
| − | An IP address is displayed in | + | An IP address is displayed in [[italic type]], using lower case letters for [[IPv6 address]]es. |
==Arguments== | ==Arguments== | ||
| Line 23: | Line 23: | ||
<code><nowiki>{{IPaddr|2001:db8:27DF:34::|64}}</nowiki></code> yields: {{IPaddr|2001:db8:27DF:34::|64}} (all lower case) as these are preferred in IPv6 addresses. | <code><nowiki>{{IPaddr|2001:db8:27DF:34::|64}}</nowiki></code> yields: {{IPaddr|2001:db8:27DF:34::|64}} (all lower case) as these are preferred in IPv6 addresses. | ||
| + | |||
==Template data== | ==Template data== | ||
| − | |||
<templatedata> | <templatedata> | ||
{ | { | ||
"description": "Template {{IPaddr}} is used to make an IP address stand out in the text, to improve readability.", | "description": "Template {{IPaddr}} is used to make an IP address stand out in the text, to improve readability.", | ||
| − | |||
"params": { | "params": { | ||
| − | |||
"1": { | "1": { | ||
"description": "The IP address to display. An IP address is displayed in italics, using lower case letters for IPv6 addresses.", | "description": "The IP address to display. An IP address is displayed in italics, using lower case letters for IPv6 addresses.", | ||
Revision as of 06:52, 31 May 2018
Introduction
Template {{IPaddr}} is used to make an IP address stand out in the text, to improve readability.
An IP address is displayed in italic type, using lower case letters for IPv6 addresses.
Arguments
The first parameter is the IP address to be displayed.
The second parameter is optional and indicates the number of bits in the network address in CIDR notation.
If given, it is appended to the first with a slash (/) as a separator.
When the option netmask=dotted is set, the second argument (if present) is translated to a dotted decimal netmask.
Examples
{{IPaddr|198.51.100.227}} yields: 198.51.100.227.
{{IPaddr|203.0.113.109/29}} adds the network mask as is: 203.0.113.109/29, but
{{IPaddr|203.0.113.109|29}} yields: 203.0.113.109/29 which adds some non-breaking space around the slash ('/') separator, to improve readability.
{{IPaddr||29}} yields just the netmask: /29.
{{IPaddr|203.0.113.109|29|netmask=dotted}} yields: 203.0.113.109/255.255.255.248, which might sometimes be useful.
{{IPaddr||18|netmask=dotted}} yields just the netmask in dotted decimal notation: 255.255.192.0 (without the slash).
{{IPaddr|2001:db8:27DF:34::|64}} yields: 2001:db8:27df:34::/64 (all lower case) as these are preferred in IPv6 addresses.
Template data
Template {{IPaddr}} is used to make an IP address stand out in the text, to improve readability.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| 1 | 1 | The IP address to display. An IP address is displayed in italics, using lower case letters for IPv6 addresses.
| String | optional |
| 2 | 2 | Number of bits in the netmask, displayed with a leading slash in CIDR notation.
| Number | optional |
| Netmask | netmask | When set to 'dotted' the netmask is displayed in dotted-decimal, rather than CIDR notation. If there is no IP address specified, the slash is not displayed.
| String | optional |