Extension:StyleByHeaderTree

Introduction
StyleByHeaderTree does two things to rendered xhtml pages:


 * it wraps each section according to the nesting hierarchy of their respective headers;
 * it may give a class and/or an id to each wrapping div, depending on the header's content and the set of rules defined for the plugin.

Use
This is useful for styling, javascripting and adding semantics. This allows for a richer presentation without additional intervention from the authors, as long as certain conventions exist regarding section headers. In our organization, we have used this primarily has a mean to bring stronger semantics to wiki pages, which was then used to produce XML content with further extensions.

The rules are written in a YAML file. Each rule specifies what class and id will be given to the created wrappers' titles matching a regular expression or an exact string.

Your Wiki's MediaWiki:Monobook.css page may then be edited to use the classes and id.

Usage Example
LocalSettings.php

rules.yml: