w/skins/MinervaNeue/resources/skins.minerva.tablet.scripts/toc.js
/**
	 * Create TableOfContents if the given Page has sections and is not the main page
	 * and wgMFTocEnabled config variable is set to true.
	 * @method
	 * @param {Page} page for which a TOC is generated
	 * @ignore
	 */
Create TableOfContents if the given Page has sections and is not the main page
and wgMFTocEnabled config variable is set to true.
@method
@param {Page} page for which a TOC is generated
@ignore
Create TableOfContents if the given Page has sections and is not the main page and wgMFTocEnabled config variable is set to true . @method @param { Page } page for which a TOC is generated @ignore
function init( page ) {
		var toc,
			sections = page.getSections(),
			$toc = $( '#toc' );
		toc = new TableOfContents( {
			sections: sections
		} );
		new Toggler( toc.$el, 'toc-', null, true );
		if ( $toc.length > 0 ) {
			$toc.replaceWith( toc.$el );
		} else {
			toc.appendTo( page.getLeadSectionElement() );
		}
	}
function init ( page ) { var toc , sections = page . getSections ( ) , $toc = $ ( '#toc' ) ; toc = new TableOfContents ( { sections : sections } ) ; new Toggler ( toc . $el , 'toc-' , null , true ) ; if ( $toc . length > 0 ) { $toc . replaceWith ( toc . $el ) ; } else { toc . appendTo ( page . getLeadSectionElement ( ) ) ; } }
Create TableOfContents if the given Page has sections and is not the main page
 and wgMFTocEnabled config variable is set to true.
Create TableOfContents if the given Page has sections and is not the main page and wgMFTocEnabled config variable is set to true .
// eslint-disable-next-line no-new // if there is a toc already, replace it // don't show toc at end of page, when no sections there // otherwise append it to the lead section