Code Monkey home page Code Monkey logo

mediawiki-headersections's Introduction

HeaderSections

A Mediawiki extension that adds a CSS class to the section of content below a header. This effectively allows for CSS styling to be applied to sections such as different background colors or indent levels for H2 and H3 sections or to target a certain section type using your own custom JavaScript.

This extension tags sections hierarchically, meaning a nested element under multiple parent headers will have current section tag (e.g. H3-section) and all parent section tags (e.g. H1-section and H2-section).

Installation

Requires Mediawiki 1.25 or higher for wfLoadExtension registration. Add the following to LocalSettings.php:

wfLoadExtension( "HeaderSections" );

Configuration

  • ext.headersections.css - Edit contents of stylesheet as required. Default configuration is set to indent each header section by an increasing amount.

Your CSS rules in ext.headersections.css needs to be in the proper order so that the higher numbered section rules (H4) take precedence over the lower- numbered section rules (H3).

Example

An example implementation of HeaderSections with the default CSS implementation can be found here:

https://consolemods.org/wiki/HeaderSections

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.