3 namespace MediaWiki\Api\Hook
;
5 use MediaWiki\Context\IContextSource
;
8 * This is a hook handler interface, see docs/Hooks.md.
9 * Use the hook name "ApiFormatHighlight" to register handlers implementing this interface.
11 * @stable to implement
14 interface ApiFormatHighlightHook
{
16 * Use this hook to syntax-highlight API pretty-printed output.
20 * @param IContextSource $context
21 * @param string $text Text to be highlighted
22 * @param string $mime MIME type of $text
23 * @param string $format API format code for $text
24 * @return bool|void True or no return value to continue, or false and add output
25 * to $context->getOutput() to highlight
27 public function onApiFormatHighlight( $context, $text, $mime, $format );