GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main page
  • Get MediaWiki
  • Get extensions
  • Tech blog
  • Contribute
  • User help
  • FAQ
  • Technical manual
  • Support desk
  • Communication
  • Developer portal
  • Code statistics
  • Community portal
  • Recent changes

This view

  • Original page
  • New address

GeezerVison is showing www.mediawiki.org — Extension:NumerAlpha - MediaWiki

Warning Warning: This extension is incompatible with plans to parallelize parsing, as is intended by the use of Parsoid . Therefore, the future of this extension is uncertain, and it is expected to become incompatible with the standard MediaWiki parser within a few years. For further information, see T250963 and No support for sequential, in-order processing of extension tags .
MediaWiki extensions manual
NumerAlpha
Release status: beta
Implementation Tag , Parser function
Description Provides methods of inserting incrementing numbers, letters, and roman numerals into pages.
Author(s) Thierry G. Veilleux (Kronoxttalk)
Latest version 0.7.0 (2020-01-25)
MediaWiki 1.25+
Database changes No
Composer mediawiki/numer-alpha
Tags

  • ‎<in>
  • ‎<ir>
  • ‎<ia>
Hooks used
  • ParserFirstCallInit
Licence The Unlicense
Download
Download extension
Git [?]:
  • Browse repository (Phabricator · GitHub)
  • Gerrit code review
  • Git commit log
  • Download source tarball
Translate the NumerAlpha extension if it is available at translatewiki.net

The NumerAlpha extension adds methods of inserting incrementing numbers, letters, and roman numerals into pages. You can reset the count at any moment or begin to a specified number.

First this extension was to supplement the Page Forms extension allowing to add a numbered table when you use the multiple option but you can also use it in templates by utilizing either the {{#tag: in |}} magic word or the {{#counter:}} parser function after v0.6.0 of this extension.

Usage

There are three forms:

  • a zero(s) padded number. (you can configure in the source code the length of your zero padded number. (0 = no zero padding)
  • Roman numeral (i, ii, iii, iv, etc.)
  • alphabetic (a,b,...,z,aa,ab,...,zz,...)

Tags

  • <in />
  • <ir />
  • <ia />

all of them in combination with reset=1 or begin=1

See examples.

Parser function

{{#counter: Counter name | type = Counter type | set = Number }}

Available counter types are "numeral", "alpha" and "roman".

Examples

Tags

Example 1

You can reset it using the parameter reset, and restart the count with the parameter begin

<ir />
<ir />
<ir />
<ir />
<ir />
<ir />
<ir />
<ir />
<ir />
<ir />

<ir reset=1 />
<ir />
<ir />
<ir />
<ir />
<ir />

<ia />
<ia />
<ia />

<ir begin=10 />
<ir />
<ir />
<ir />

That will be render like

i ii iii iv v vi vii viii ix


i ii iii iv v


a b c

x xi xii xiii

So it's easy to list the alphabet:

<ia reset=1 /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia /><ia />

abcdefghijklmnopqrstuvwxyz

Example 2
<ia>hello</ia>
<ia>world</ia>
<ia reset=1>goodbye</ia>
<ia>world</ia>
<ia begin=11>jupiter</ia>
<ia>jazz</ia>
<in>hello</in>
<in>world</in>
<in reset=1>goodbye</in>
<in>world</in>
<in begin=11>jupiter</in>
<in>jazz</in>
<ir>hello</ir>
<ir>world</ir>
<ir reset=1>goodbye</ir>
<ir>world</ir>
<ir begin=11>jupiter</ir>
<ir>jazz</ir>

Parser function

Wikitext (since version 0.6.0)
{{#counter: ExampleCounter |type=numeral |set=9 }}
{{#counter: ExampleCounter }}
{{#counter: ExampleCounter }}
Result

9
10
11

If you want to start the numbering with a given number on a per page basis you have to add the "type" and "set" parameters, e.g. |type=numeral and |set=1 to the first call to the "counter" parser function of the page. If you do not do this the "counter" parser function will increment its number throughout the pages of whole wiki using it.
Wikitext (since version 0.7.0)
{{#counter: list-with-levels |level prefix=: }} Start lev 1
{{#counter: }} Stay lev 1
{{#counter: |level=2 }} Jump to lev 2
{{#counter: }} Stay lev 2
{{#counter: |level=1 }} Drop to lev 1
{{#counter: |level=2 }} back to lev 2
{{#counter: |level=3 }} jump to lev 3
Result
1
2
1
2
3
1
1

This allows you to have hierarchical lists. Furthermore, if you add "format=outline" to the first #counter you can get output like:

1
2
2.1
2.2
3
3.1
3.1.1

Installation

  • Download and move the extracted NumerAlpha folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/NumerAlpha
    
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'NumerAlpha' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

See also

  • Extension:ID Generator - Generates incremental numeric IDs unique per wiki
This extension is included in the following wiki farms/hosts and/or packages:
  • Canasta
Retrieved from "https://www.mediawiki.org/w/index.php?title=Extension:NumerAlpha&oldid=8131522"
Categories:
  • Beta status extensions
  • Tag extensions
  • Parser function extensions
  • Extensions supporting Composer
  • ParserFirstCallInit extensions
  • The Unlicense licensed extensions
  • Extensions in Wikimedia version control
  • All extensions
  • Extensions included in Canasta
Hidden categories:
  • Extensions without an image
  • Extensions without a compatibility policy
  • Extensions with manual MediaWiki version
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.