扩展:ActiveAbstract
Appearance
ActiveAbstract 发行状态: 稳定版 |
|
---|---|
实现 | 扩展语法 |
描述 | Generate an XML feed for Yahoo's Active Abstracts project |
作者 | Brooke Vibber留言 |
兼容性政策 | 快照跟随MediaWiki发布。 master分支不向后兼容。 |
MediaWiki | 1.25+ |
许可协议 | GNU通用公眾授權條款2.0或更新版本 |
下載 | |
季度下載量 | 9 (Ranked 127th) |
前往translatewiki.net翻譯ActiveAbstract扩展 | |
問題 | 开启的任务 · 报告错误 |
This extension is used with XML dumps to pull a formatted copy of an article's initial text and its organizational structure. It is one of the filters available for the backup system.
It will pull the first two sentences of the article along with each section heading and wrap them in XML tags and trim the entry to be no longer than 1024 characters.
安裝
- 下载文件,并将解压后的
ActiveAbstract
文件夹移动到extensions/
目录中。
开发者和代码贡献人员应从Git安装扩展,输入:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ActiveAbstract - 将下列代码放置在您的LocalSettings.php 的底部:
wfLoadExtension( 'ActiveAbstract' );
- 完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。
参数
ActiveAbstract is run as a plugin for dumpBackup.php:
php dumpBackup.php \
--plugin=AbstractFilter:extensions/ActiveAbstract/AbstractFilter.php \
--current \
--output=gzip:/dumps/abstract.xml.gz \
--filter=namespace:NS_MAIN \
--filter=noredirect \
--filter=abstract
位于:
- current - pulls only the latest article revision
- output - sets where the output stream will go
- filters
- namespace - only pull documents from this namespace
- noredirect - don't show redirects
- abstract - registers the abstracts filter and runs it from within dumpBackup.php
- variants - if variants exist, pull all latest copies and output them to a separate abstracts file
It can optionally convert output text to a given language variant:
--filter=abstract:variant=zh-cn
A possible way to run this in production would be
/usr/bin/php -q /apache/common/php-1.5/maintenance/dumpBackup.php --wiki='quwiki' \
--plugin=AbstractFilter:/apache/common/php-1.5/extensions/ActiveAbstract/AbstractFilter.php \
--current --report=1000 --force-normal --server='x.x.x.x' \
--output=file:/mnt/dumps/public/quwiki/20090613/quwiki-20090613-abstract.xml \
--filter=namespace:NS_MAIN --filter=noredirect --filter=abstract
force-normal is added for better UTF-8 conversion.
格式化
The required tags for each entry are:
- doc
- title
- url
- abstract
- links
- sublink
示例表
<doc>
<title>Wikipedia: An American in Paris</title>
<url>http://en.wikipedia.org/wiki/An_American_in_Paris</url>
<abstract>An American in Paris is a symphonic composition by American composer George Gershwin, composed in 1928. Inspired .. </abstract>
<links>
<sublink linktype="nav"><anchor>Instrumentation</anchor><link>http://en.wikipedia.org/wiki/An_American_in_Paris#Instrumentation</link></sublink>
<sublink linktype="nav"><anchor>Recordings</anchor><link>http://en.wikipedia.org/wiki/An_American_in_Paris#Recordings</link></sublink>
<sublink linktype="nav"><anchor>Film</anchor><link>http://en.wikipedia.org/wiki/An_American_in_Paris#Film</link></sublink>
</links>
</doc>
The
<abstract>
text is trimmed to not run off this wiki page.This extension is currently being used to generate part of the Wikimedia Xml Database Dumps. It is not meant to be used exclusively within MediaWiki but instead allows for content to be exported from your wiki installation into a specific format. |
此扩展用于一个或多个维基媒体项目。 这可能意味着扩展足够稳定、运作足够良好,可以用在这样的高流量的网站上。 请在维基媒体的CommonSettings.php和InitialiseSettings.php配置文件中查找此扩展的名称以查看哪些网站安装了该扩展。 特定wiki上的已安装的扩展的完整列表位于Special:Version页面。 |