Extension:HeaderCount
Release status: stableCategory:Stable extensions |
|
|---|---|
| Implementation | Parser extensionCategory:Parser extensions, Parser functionCategory:Parser function extensions |
| Description | Adds a parser function to get the amount of headers or sections in a page. |
| Author(s) | Eli Foster (SatanicSantatalk) |
| Latest version | 1.0.6 (2024-03-02) |
| MediaWiki | Category:Extensions without MediaWiki version |
| Licence | MIT License |
| Download | GitHub:
Category:Extensions in GitHub version controlNote: 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.
Installation
- Download and place the file(s) in a directory called
HeaderCountin yourextensions/folder. - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'HeaderCount' );
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage
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.
Category:All extensions
Category:Extensions in GitHub version control
Category:Extensions not in ExtensionJson
Category:Extensions without MediaWiki version
Category:Extensions without a compatibility policy
Category:Extensions without an image
Category:MIT licensed extensions
Category:ParserFirstCallInit extensions
Category:Parser extensions
Category:Parser function extensions
Category:Stable extensions
