Extension:HeaderCount

Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:MIT licensed extensions
MediaWiki extensions manual
HeaderCount
Release status: stableCategory:Stable extensions
Implementation Parser extension Category:Parser extensions, Parser function Category: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
License MIT License
Download Category:Extensions in GitHub version control
README.md
CHANGELOG.md
Category:All extensionsCategory:Extensions not in ExtensionJson

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 HeaderCount in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'HeaderCount' );
    
  • Yes 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