Extension:HeaderCount
This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. |
![]() Release status: unmaintained |
|
---|---|
Implementation | Parser extension , Parser function |
Description | Quickly counting the number of sections/headers in a page. |
Author(s) | Eli Clemente Gordillo Foster (SatanicSantatalk) |
Latest version | 1.0.4 (2017-10-19) |
MediaWiki | |
License | MIT License |
Download | GitHub: Note: README.md CHANGELOG.md |
The HeaderCount extension adds a simple parser function for obtaining the number of headers, or sections, in a page.
The extension is invoked with the {{#headcount:...}}
parser function.
InstallationEdit
- Download and place the file(s) in a directory called
HeaderCount
in yourextensions/
folder. - Add the following code at the bottom of your
LocalSettings.php
:wfLoadExtension( 'HeaderCount' );
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
To users running MediaWiki 1.24 or earlier:
The instructions above describe the new way of installing this extension using wfLoadExtension()
.
If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'HeaderCount' );
, you need to use:
require_once "$IP/extensions/HeaderCount/HeaderCount.php";
UsageEdit
Using this extension is fairly straight forward. The #headcount
function has 2 parameters: page, and level.
When the first parameter is omitted ({{#headcount:}}
), it will use the current page.
When the second parameter is omitted ({{#headcount:Page}}
), it will use 2, as in level 2 headers.