Manual:Hooks/ParserLogLinterData

From Linux Web Expert

Revision as of 18:38, 14 February 2023 by imported>Pppery
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

ParserLogLinterData
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 774563)</tvar></translate>
Report lints from Parsoid to the Linter extension
<translate> Define function:</translate>
public static function onParserLogLinterData( string $title, int $revId, array $lints ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"ParserLogLinterData": "MediaWiki\\Extension\\MyExtension\\Hooks::onParserLogLinterData"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> include/parser/Parsoid/Config/DataAccess.php
<translate> Function(s):</translate> logLinterData
<translate> Interface:</translate> ParserLogLinterDataHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:ParserLogLinterData extensions</tvar>.</translate>


Parameters

  • $title: string representing a page title
  • $revId: int representing the revision ID of the page being parsed
  • $lints: array of linting data corresponding to the given revision of the page

Use cases

Currently, Linter uses this extension. The Linter will record the given lint information for the page. If the Linter extension is not installed, then the lints are discarded.

Notes