mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TextExtracts
synced 2024-11-15 03:35:20 +00:00
11cb9bd3b8
* Remove WMF-specific classes already present in mediawiki-config * Remove TOC via standard ParserOutput functions, it's faster this way * Comment the remaining classes Change-Id: Ic2479dbd842b910722114449d3465d9f1ce76078
70 lines
2.2 KiB
PHP
70 lines
2.2 KiB
PHP
<?php
|
|
/**
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
*
|
|
* @file
|
|
*/
|
|
|
|
$wgExtensionCredits['other'][] = array(
|
|
'path' => __FILE__,
|
|
'name' => 'TextExtracts',
|
|
'author' => array( 'Max Semenik' ),
|
|
'descriptionmsg' => 'textextracts-desc',
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:TextExtracts',
|
|
);
|
|
|
|
define( 'TEXT_EXTRACTS_INSTALLED', true );
|
|
|
|
$dir = __DIR__;
|
|
$wgMessagesDirs['TextExtracts'] = __DIR__ . '/i18n';
|
|
$wgExtensionMessagesFiles['TextExtracts'] = "$dir/TextExtracts.i18n.php";
|
|
|
|
|
|
$wgAutoloadClasses['ExtractFormatter'] = "$dir/ExtractFormatter.php";
|
|
$wgAutoloadClasses['ApiQueryExtracts'] = "$dir/ApiQueryExtracts.php";
|
|
$wgAPIPropModules['extracts'] = 'ApiQueryExtracts';
|
|
$wgHooks['OpenSearchXml'][] = 'ApiQueryExtracts::onOpenSearchXml';
|
|
$wgHooks['UnitTestsList'][] = function( &$files ) {
|
|
$files[] = __DIR__ . '/ExtractFormatterTest.php';
|
|
return true;
|
|
};
|
|
|
|
|
|
// Configuration variables
|
|
|
|
/**
|
|
* Selectors of content to be removed from HTML
|
|
*/
|
|
$wgExtractsRemoveClasses = array(
|
|
// These usually represent content that is not part of usual text flow
|
|
'table', 'div',
|
|
// Section edit links
|
|
'.mw-editsection',
|
|
// Extension:Cite references
|
|
'sup.reference',
|
|
// Used by parser for various wikitext errors, no point having them in extracts
|
|
'.error',
|
|
// Ignored in MobileFrontend. @todo: decide if it's really needed
|
|
'.nomobile',
|
|
// Class specifically for this extension
|
|
'.noexcerpt',
|
|
);
|
|
|
|
/**
|
|
* Whether this extension should provide its extracts for Extension:OpenSearchXml
|
|
*/
|
|
$wgExtractsExtendOpenSearchXml = false;
|