User:Inductiveload/easy lst

Easy LST is a Gadget which helps simplify the syntax for Labelled Section Transclusion (LST).

This gadget is enabled by default.

LST syntax
Natively (without this gadget), Labelled Section Transclusion looks like this in the Wikitext:

Section 1 Text Section 2 Text

If the start and end tags do not match, the page may not transclude correctly. Easy Section Syntax handles the tag open and closing and changes the syntax to:

Section 1 Text Section 2 Text
 * 1) s1 ##
 * 1) s2 ##

This makes it much less likely the tags are mis-matched, which can cause silent transclusion errors.

Configuration
By default, the Easy Section Syntax gadget is enabled. You can turn it of full in your gadget preferences, or you can selectively disable it though the configuration method.

You can configure the Easy Section Syntax gadget using the  hook and passing a configuration object.

Example
{ // Disable Easy Section Syntax on DNB pages var use_easy_ss_on_this_page = !mw.config.get("wgTitle").startsWith("Dictionary of National Biography");

var easySectionSyntaxConfig = { enabled: use_easy_ss_on_this_page, };

// send configuration mw.hook("easy_section_syntax.config").fire(easySectionSyntaxConfig); }

There are the following options that you can pass into the configuration hook:


 * : set to false to disable the gadget
 * : set to true to output some extra logging