This site is supported by donations to The OEIS Foundation.

Template:Namespace ID/test

From OeisWiki
Jump to: navigation, search
This is the testing template for the {{namespace ID}} OEIS Wiki utility template. [<Edit> Template:Namespace ID]

NOTE: The Media namespace (namespace ID = -2) is disabled on OEISWiki.

Tests

Tests with namespace names

Code Result
{{ns ID|media}} -2
  
{{ns ID|special}} -1
  
{{ns ID}}

{{ns ID|main}}
{{ns ID|article}}

0

0
0

  
{{ns ID|talk}}

{{ns ID|article talk}}
{{ns ID|article+}}

1

1
1

  
{{ns ID|user}} 2
  
{{ns ID|user talk}}

{{ns ID|user+}}

3

3

  
{{ns ID|project}}

{{ns ID|oeiswiki}}

4

4

  
{{ns ID|project talk}}

{{ns ID|project+}}
{{ns ID|oeiswiki talk}}
{{ns ID|oeiswiki+}}

5

5
5
5

  
{{ns ID|image}}

{{ns ID|file}}

6

6

  
{{ns ID|image talk}}

{{ns ID|image+}}
{{ns ID|file talk}}
{{ns ID|file+}}

7

7
7
7

  
{{ns ID|mediawiki}} 8
  
{{ns ID|mediawiki talk}}

{{ns ID|mediawiki+}}

9

9

  
{{ns ID|template}} 10
  
{{ns ID|template talk}}

{{ns ID|template+}}

11

11

  
{{ns ID|help}} 12
  
{{ns ID|help talk}}

{{ns ID|help+}}

13

13

  
{{ns ID|category}} 14
  
{{ns ID|category talk}}

{{ns ID|category+}}

15

15

  
{{ns ID|extras}} 100
  
{{ns ID|extras talk}}

{{ns ID|extras+}}

101

101

Tests with namespace abbreviations

Code Result
{{ns ID|m}} -2
  
{{ns ID|s}} -1
  
{{ns ID|a}}

{{ns ID}}

0

0

  
{{ns ID|a+}}

{{ns ID|+}}

1

1

  
{{ns ID|u}} 2
  
{{ns ID|u+}} 3
  
{{ns ID|p}}

{{ns ID|ow}}

4

4

  
{{ns ID|p+}}

{{ns ID|ow+}}

5

5

  
{{ns ID|i}}

{{ns ID|f}}

6

6

  
{{ns ID|i+}}

{{ns ID|f+}}

7

7

  
{{ns ID|mw}} 8
  
{{ns ID|mw+}} 9
  
{{ns ID|t}} 10
  
{{ns ID|t+}} 11
  
{{ns ID|h}} 12
  
{{ns ID|h+}} 13
  
{{ns ID|c}} 14
  
{{ns ID|c+}} 15
  
{{ns ID|e}} 100
  
{{ns ID|e+}} 101

Tests with namespace IDs

Code Result
{{ns ID|-2}} -2
{{ns ID|-1}} -1
{{ns ID|0}} 0
{{ns ID|1}} 1
{{ns ID|2}} 2
{{ns ID|3}} 3
{{ns ID|4}} 4
{{ns ID|5}} 5
{{ns ID|6}} 6
{{ns ID|7}} 7
{{ns ID|8}} 8
{{ns ID|9}} 9
{{ns ID|10}} 10
{{ns ID|11}} 11
{{ns ID|12}} 12
{{ns ID|13}} 13
{{ns ID|14}} 14
{{ns ID|15}} 15
{{ns ID|100}} 100
{{ns ID|101}} 101

Namespaces

With the ns: parser function we get namespace name (empty string for article (Main) default namespace) from namespace ID

Code Result
{{ns:-2}} Media
{{ns:-1}} Special
{{ns:0}}
{{ns:1}} Talk
{{ns:2}} User
{{ns:3}} User talk
{{ns:4}} OeisWiki
{{ns:5}} OeisWiki talk
{{ns:6}} File
{{ns:7}} File talk
{{ns:8}} MediaWiki
{{ns:9}} MediaWiki talk
{{ns:10}} Template
{{ns:11}} Template talk
{{ns:12}} Help
{{ns:13}} Help talk
{{ns:14}} Category
{{ns:15}} Category talk
{{ns:100}} Extras
{{ns:101}} Extras talk

Wiki variables

NOTE: The Media namespace ({{namespace ID|Media}} = −2) is disabled on OEIS Wiki.

Wiki variables
[⧼Purge⧽ Template:Wikivar] [<Edit> Template:Wikivar]


Namespaces
variable generates
(common namespaces: -2 to 15) (used at all MediaWiki projects)
{{ns:-2}}[1] {{ns:Media}}[1]   Media
{{ns:-1}} {{ns:Special}}   Special
{{ns:0}}[2]
 
 
{{MediaWiki:Blanknamespace}}
 
  (Main)
{{ns:1}} {{ns:Talk}}   Talk
{{ns:2}} {{ns:User}}   User
{{ns:3}} {{ns:User_talk}}   User talk
{{ns:4}} {{ns:Project}}   OeisWiki
{{ns:5}} {{ns:Project_talk}}   OeisWiki talk
{{ns:6}} {{ns:Image}}   File
{{ns:7}} {{ns:Image_talk}}   File talk
{{ns:8}} {{ns:MediaWiki}}   MediaWiki
{{ns:9}} {{ns:MediaWiki_talk}}   MediaWiki talk
{{ns:10}} {{ns:Template}}   Template
{{ns:11}} {{ns:Template_talk}}   Template talk
{{ns:12}} {{ns:Help}}   Help
{{ns:13}} {{ns:Help_talk}}   Help talk
{{ns:14}} {{ns:Category}}   Category
{{ns:15}} {{ns:Category_talk}}   Category talk
{{ns:100}} {{ns:Extras}}   Extras
{{ns:101}} {{ns:Extras_talk}}   Extras talk


Current date and time
(Universal Time Coordinated —UTC)
variable generates
{{CURRENTDAY}}   3
{{CURRENTDAY2}}[3]   03
{{CURRENTDAYNAME}}   Sunday
{{CURRENTDOW}}   0
{{CURRENTMONTH}}   11
{{CURRENTMONTHABBREV}}   Nov
{{CURRENTMONTHNAME}}   November
{{CURRENTMONTHNAMEGEN}}   November
{{CURRENTTIME}}   08:58
{{CURRENTWEEK}}   44
{{CURRENTYEAR}}   2024


Local date and time
(OEIS Wiki Server Time)
variable generates
{{LOCALDAY}}   3
{{LOCALDAY2}}[3]   03
{{LOCALDAYNAME}}   Sunday
{{LOCALDOW}}   0
{{LOCALMONTH}}   11
{{LOCALMONTHABBREV}}   Nov
{{LOCALMONTHNAME}}   November
{{LOCALMONTHNAMEGEN}}   November
{{LOCALTIME}}   03:58
{{LOCALWEEK}}   44
{{LOCALYEAR}}   2024


Common MediaWiki variables
variable generates
{{BASEPAGENAME}}[4]   Namespace ID
{{BASEPAGENAMEE}}[5][6]   Namespace_ID
{{FULLPAGENAME}}   Template:Namespace ID/test
{{FULLPAGENAMEE}}[5]   Template:Namespace_ID/test
{{NAMESPACE}}   Template
{{NAMESPACEE}}[5]   Template
{{NUMBEROFARTICLES}}   179,327
{{NUMBEROFFILES}}   3,847
{{PAGENAME}}   Namespace ID/test
{{PAGENAMEE}}[5]   Namespace_ID/test
{{SUBPAGENAME}}[7]   test
{{SUBPAGENAMEE}}[5][8]   test
{{REVISIONID}}[9]   1579426
{{CURRENTVERSION}}   1.30.0
{{SCRIPTPATH}}   /w
{{SERVER}}   https://oeis.org
{{SERVERNAME}}   oeis.org
{{SITENAME}}   OeisWiki



Code

<noinclude>{{Documentation}}</noinclude><includeonly>{{#switch: {{lc: {{#replace: {{{1|}}} |_| }} }} <!-- underscore replaced by space -->
| media              | m   |  -2 = -2   <!-- Media -->  
| special            | s   |  -1 = -1   <!-- Special -->
| main               | a   |   0 = 0    | article = 0       |   = 0   <!-- {{MediaWiki:Blanknamespace}} = (Main) --> 
| talk               | a+  |   1 = 1    | article talk = 1  | + = 1   | article+ = 1                 <!-- Talk -->
| user               | u   |   2 = 2                                                                 <!-- User -->
| user talk          | u+  |   3 = 3    | user+ = 3                                                  <!-- User talk -->
| project            | p   |   4 = 4    | oeiswiki = 4      | ow = 4                                 <!-- OeisWiki -->
| project talk       | p+  |   5 = 5    | oeiswiki talk = 5 | ow+ = 5 | project+ = 5 | oeiswiki+ = 5 <!-- OeisWiki talk -->
| image              | i   |   6 = 6    | file = 6          | f = 6                                  <!-- File -->
| image talk         | i+  |   7 = 7    | file talk = 7     | f+ = 7  | image+ = 7 | file+ = 7       <!-- File talk -->   
| mediawiki          | mw  |   8 = 8                     <!-- MediaWiki -->  
| mediawiki talk     | mw+ |   9 = 9    | mediawiki+ = 9 <!-- MediaWiki talk -->  
| template           | t   |  10 = 10                    <!-- Template -->
| template talk      | t+  |  11 = 11   | template+ = 11 <!-- Template talk --> 
| help               | h   |  12 = 12                    <!-- Help -->  
| help talk          | h+  |  13 = 13   | help+ = 13     <!-- Help talk -->  
| category           | c   |  14 = 14                    <!-- Category -->  
| category talk      | c+  |  15 = 15   | category+ = 15 <!-- Category talk -->
| extras             | e   | 100 = 100                   <!-- Extras -->  
| extras talk        | e+  | 101 = 101  | extras+ = 101  <!-- Extras talk --><!--
-->
| #default = {{error| Namespace ID error: Invalid namespace }}
}}

Notes

  1. 1.0 1.1 The Media namespace ({{namespace ID|Media}} = −2) is disabled on OEIS Wiki.
  2. Returns empty string.
  3. 3.0 3.1 Always show 2 digits (with leading 0 if required).
  4. See {{basepage name}}.
  5. 5.0 5.1 5.2 5.3 5.4 URL encoded version.
  6. See {{basepage name|e}}.
  7. See {{subpage name}}.
  8. See {{subpage name|e}}.
  9. Revision ID of the current page (changes with each saved edit).